Skip to content

Commit a4ddb92

Browse files
authored
Merge pull request #3831 from Kotlin/bobova/addOptIn
Add Optin for kotlinx.cinterop.UnsafeNumber due to KT-59859
2 parents 1a09305 + 1781a1e commit a4ddb92

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kotlinx-coroutines-core/nativeDarwin/src/Dispatchers.kt

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ internal actual fun createMainDispatcher(default: CoroutineDispatcher): MainCoro
1818
internal actual fun createDefaultDispatcher(): CoroutineDispatcher = DarwinGlobalQueueDispatcher
1919

2020
private object DarwinGlobalQueueDispatcher : CoroutineDispatcher() {
21+
@OptIn(UnsafeNumber::class)
2122
override fun dispatch(context: CoroutineContext, block: Runnable) {
2223
autoreleasepool {
2324
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT.convert(), 0u)) {
@@ -76,6 +77,7 @@ private val TIMER_DISPOSED = NativePtr.NULL.plus(1)
7677
private class Timer : DisposableHandle {
7778
private val ref = AtomicNativePtr(TIMER_NEW)
7879

80+
@OptIn(UnsafeNumber::class)
7981
fun start(timeMillis: Long, timerBlock: TimerBlock) {
8082
val fireDate = CFAbsoluteTimeGetCurrent() + timeMillis / 1000.0
8183
val timer = CFRunLoopTimerCreateWithHandler(null, fireDate, 0.0, 0u, 0, timerBlock)

0 commit comments

Comments
 (0)