Remove unneeded zeroing TLS (#4480)
This commit is contained in:
committed by
Stanislav Erokhin
parent
1a97a6ca1a
commit
4297b521e4
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
import kotlin.native.concurrent.*
|
||||
|
||||
@ThreadLocal
|
||||
var x = Any()
|
||||
|
||||
fun main() {
|
||||
val worker = Worker.start()
|
||||
|
||||
worker.execute(TransferMode.SAFE, {}) {
|
||||
println(x) // Make sure x is initialized
|
||||
}.result
|
||||
|
||||
worker.requestTermination().result
|
||||
}
|
||||
Reference in New Issue
Block a user