这似乎与:androidx/datastore/multiprocess/SharedCounter.kt
有关,它可能提供后台访问控制.参见androidx.datastore.core
,例如DataStoreImpl<T>
:
/**
* If downstream flow is UnInitialized, no data has been read yet, we need to trigger a new
* read then start emitting values once we have seen a new value (or exception).
*
* If downstream flow has a ReadException, there was an exception last time we tried to read
* data. We need to trigger a new read then start emitting values once we have seen a new
* value (or exception).
*
* If downstream flow has Data, we should start emitting from downstream flow as long as its
* version is not stale compared to the version read from the shared counter when we enter
* the flow.
*
* If Downstream flow is Final, the scope has been cancelled so the data store is no
* longer usable. We should just propagate this exception.
*
* State always starts at null. null can transition to ReadException, Data or
* Final. ReadException can transition to another ReadException, Data or Final.
* Data can transition to another Data or Final. Final will not change.
*/
名称multiprocess
与涉及多个处理器的"多处理"的定义不一致-因为实际上,Forking 线程在哪个处理器上运行并不重要.