File tree 15 files changed +18
-46
lines changed
androidNative32BitMain/kotlin/kotlinx/atomicfu/parking
androidNative64BitMain/kotlin/kotlinx/atomicfu/parking
apple32Main/kotlin/kotlinx/atomicfu/parking
apple64Main/kotlin/kotlinx/atomicfu/parking
concurrentMain/kotlin/kotlinx/atomicfu/parking
jsAndWasmSharedMain/kotlin/kotlinx/atomicfu/parking
jvmTest/kotlin/kotlinx/atomicfu/test/parking
linux32Main/kotlin/kotlinx/atomicfu/parking
mingwMain/kotlin/kotlinx/atomicfu/parking
nativeTest/kotlin/kotlinx/atomicfu/parking 15 files changed +18
-46
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ kotlin {
93
93
implementation(libs.junit.junit)
94
94
}
95
95
}
96
+
97
+ val concurrentMain by creating { dependsOn(commonMain.get()) }
98
+ val jvmMain by getting { dependsOn(concurrentMain) }
96
99
}
97
100
}
98
101
@@ -131,16 +134,20 @@ kotlin {
131
134
applyDefaultHierarchyTemplate()
132
135
133
136
sourceSets {
134
- val nativeUnixLikeMain by creating { dependsOn(nativeMain.get()) }
137
+
138
+ val concurrentMain by getting {}
139
+ val nativeMain by getting { dependsOn(concurrentMain) }
140
+
141
+ val nativeUnixLikeMain by creating { dependsOn(nativeMain) }
135
142
136
143
137
- val androidNative64BitMain by creating { dependsOn(nativeMain.get() ) }
144
+ val androidNative64BitMain by creating { dependsOn(nativeMain) }
138
145
androidNative64BitMain.also {
139
146
androidNativeArm64Main.get().dependsOn(it)
140
147
androidNativeX64Main.get().dependsOn(it)
141
148
}
142
149
143
- val androidNative32BitMain by creating { dependsOn(nativeMain.get() ) }
150
+ val androidNative32BitMain by creating { dependsOn(nativeMain) }
144
151
androidNative32BitMain.let {
145
152
androidNativeArm32Main.get().dependsOn(it)
146
153
androidNativeX86Main.get().dependsOn(it)
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import kotlinx.atomicfu.AtomicBoolean
4
4
import kotlinx.atomicfu.atomic
5
5
import kotlinx.cinterop.*
6
6
import kotlinx.cinterop.alloc
7
- import kotlinx.cinterop.free
8
7
import kotlinx.cinterop.pointed
9
8
import kotlinx.cinterop.ptr
10
9
import platform.posix.*
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import kotlinx.atomicfu.AtomicBoolean
4
4
import kotlinx.atomicfu.atomic
5
5
import kotlinx.cinterop.*
6
6
import kotlinx.cinterop.alloc
7
- import kotlinx.cinterop.free
8
7
import kotlinx.cinterop.pointed
9
8
import kotlinx.cinterop.ptr
10
9
import platform.posix.*
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import kotlinx.atomicfu.AtomicBoolean
4
4
import kotlinx.atomicfu.atomic
5
5
import kotlinx.cinterop.*
6
6
import kotlinx.cinterop.alloc
7
- import kotlinx.cinterop.free
8
7
import kotlinx.cinterop.pointed
9
8
import kotlinx.cinterop.ptr
10
9
import platform.posix.*
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import kotlinx.atomicfu.AtomicBoolean
4
4
import kotlinx.atomicfu.atomic
5
5
import kotlinx.cinterop.*
6
6
import kotlinx.cinterop.alloc
7
- import kotlinx.cinterop.free
8
7
import kotlinx.cinterop.pointed
9
8
import kotlinx.cinterop.ptr
10
9
import platform.posix.*
File renamed without changes.
File renamed without changes.
File renamed without changes.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import kotlinx.atomicfu.parking.Parker
5
5
import java.util.concurrent.atomic.AtomicInteger
6
6
import java.util.concurrent.atomic.AtomicIntegerArray
7
7
import java.util.concurrent.atomic.AtomicReference
8
- import kotlin.concurrent.thread
9
8
import kotlin.random.Random
10
9
import kotlin.test.Test
11
10
import kotlin.test.fail
Original file line number Diff line number Diff line change @@ -91,9 +91,9 @@ class ThreadParkingStressTest {
91
91
while (! done0.get() || ! done1.get()) {
92
92
sleep(Random .nextLong(0 , 5 ))
93
93
if (Random .nextBoolean()) {
94
- kthread0.get()?.let {Parker .unpark(it)}
94
+ kthread0.get()?.let { Parker .unpark(it)}
95
95
} else {
96
- kthread1.get()?.let {Parker .unpark(it)}
96
+ kthread1.get()?.let { Parker .unpark(it)}
97
97
}
98
98
}
99
99
}
@@ -102,9 +102,9 @@ class ThreadParkingStressTest {
102
102
while (! done0.get() || ! done1.get()) {
103
103
sleep(Random .nextLong(0 , 5 ))
104
104
if (Random .nextBoolean()) {
105
- kthread0.get()?.let {Parker .unpark(it)}
105
+ kthread0.get()?.let { Parker .unpark(it)}
106
106
} else {
107
- kthread1.get()?.let {Parker .unpark(it)}
107
+ kthread1.get()?.let { Parker .unpark(it)}
108
108
}
109
109
}
110
110
}
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import kotlinx.atomicfu.AtomicBoolean
4
4
import kotlinx.atomicfu.atomic
5
5
import kotlinx.cinterop.*
6
6
import kotlinx.cinterop.alloc
7
- import kotlinx.cinterop.free
8
7
import kotlinx.cinterop.pointed
9
8
import kotlinx.cinterop.ptr
10
9
import platform.posix.*
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import kotlinx.atomicfu.AtomicBoolean
4
4
import kotlinx.atomicfu.atomic
5
5
import kotlinx.cinterop.*
6
6
import kotlinx.cinterop.alloc
7
- import kotlinx.cinterop.free
8
7
import kotlinx.cinterop.pointed
9
8
import kotlinx.cinterop.ptr
10
9
import platform.posix.*
Original file line number Diff line number Diff line change @@ -99,9 +99,9 @@ class ThreadParkingStressTest {
99
99
while (! ppt.done0.value || ! ppt.done1.value) {
100
100
usleep(Random .nextUInt(0u , 500u ))
101
101
if (Random .nextBoolean()) {
102
- ppt.thread0.value?.let {Parker .unpark(it)}
102
+ ppt.thread0.value?.let { Parker .unpark(it)}
103
103
} else {
104
- ppt.thread1.value?.let {Parker .unpark(it)}
104
+ ppt.thread1.value?.let { Parker .unpark(it)}
105
105
}
106
106
}
107
107
}
@@ -110,9 +110,9 @@ class ThreadParkingStressTest {
110
110
while (! ppt.done0.value || ! ppt.done1.value) {
111
111
usleep(Random .nextUInt(0u , 500u ))
112
112
if (Random .nextBoolean()) {
113
- ppt.thread0.value?.let {Parker .unpark(it)}
113
+ ppt.thread0.value?.let { Parker .unpark(it)}
114
114
} else {
115
- ppt.thread1.value?.let {Parker .unpark(it)}
115
+ ppt.thread1.value?.let { Parker .unpark(it)}
116
116
}
117
117
}
118
118
}
You can’t perform that action at this time.
0 commit comments