File tree Expand file tree Collapse file tree 5 files changed +17
-58
lines changed
androidNative64BitMain/kotlin/kotlinx/atomicfu/locks
androidNativeMain/kotlin/kotlinx/atomicfu/locks
linuxMain/kotlin/kotlinx/atomicfu/locks
mingwMain/kotlin/kotlinx/atomicfu/locks
nativeNonAppleMain/kotlin/kotlinx/atomicfu/locks Expand file tree Collapse file tree 5 files changed +17
-58
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
*/
4
4
package kotlinx.atomicfu.locks
5
5
6
+ import kotlinx.atomicfu.atomic
6
7
import kotlinx.cinterop.Arena
7
8
import kotlinx.cinterop.ExperimentalForeignApi
9
+ import kotlinx.cinterop.UnsafeNumber
8
10
import kotlinx.cinterop.alloc
9
11
import kotlinx.cinterop.ptr
10
12
import platform.posix.*
11
13
12
- @OptIn(ExperimentalForeignApi ::class )
14
+ @OptIn(ExperimentalForeignApi ::class , UnsafeNumber :: class )
13
15
actual class NativeMutexNode {
14
16
actual var next: NativeMutexNode ? = null
15
17
@@ -49,3 +51,7 @@ actual class NativeMutexNode {
49
51
arena.clear()
50
52
}
51
53
}
54
+
55
+ private val threadCounter = atomic(0L )
56
+
57
+ actual fun createThreadId (): Long = threadCounter.incrementAndGet()
Original file line number Diff line number Diff line change 3
3
*/
4
4
package kotlinx.atomicfu.locks
5
5
6
+ import kotlinx.atomicfu.atomic
6
7
import kotlinx.cinterop.Arena
7
8
import kotlinx.cinterop.ExperimentalForeignApi
8
9
import kotlinx.cinterop.alloc
@@ -48,3 +49,7 @@ actual class NativeMutexNode {
48
49
arena.clear()
49
50
}
50
51
}
52
+
53
+ private val threadCounter = atomic(0L )
54
+
55
+ internal actual fun createThreadId (): Long = threadCounter.incrementAndGet()
Original file line number Diff line number Diff line change 3
3
*/
4
4
package kotlinx.atomicfu.locks
5
5
6
+ import kotlinx.atomicfu.atomic
6
7
import kotlinx.cinterop.Arena
7
8
import kotlinx.cinterop.ExperimentalForeignApi
8
9
import kotlinx.cinterop.alloc
@@ -48,3 +49,7 @@ actual class NativeMutexNode {
48
49
arena.clear()
49
50
}
50
51
}
52
+
53
+ private val threadCounter = atomic(0L )
54
+
55
+ actual fun createThreadId (): Long = threadCounter.incrementAndGet()
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments