v0.3.2-SNAPSHOT: added android-specific code and implementation, including defaultNamedStorage()
This commit is contained in:
1 parent
1a46c8cab3
commit
972b033be1
7 files changed
+169
-3
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package net.sergeych.synctools
|
||||
|
||||
import java.util.concurrent.locks.ReentrantLock
|
||||
|
||||
/**
|
||||
* Android actual implementation mirrors JVM using [ReentrantLock].
|
||||
*/
|
||||
actual fun ProtectedOp(): ProtectedOpImplementation = object : ProtectedOpImplementation {
|
||||
private val access = ReentrantLock()
|
||||
override fun lock() {
|
||||
access.lock()
|
||||
}
|
||||
|
||||
override fun unlock() {
|
||||
access.unlock()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user