Marked global mutable state in the benchmark as thread local
This commit is contained in:
committed by
Sergey Bogolepov
parent
d04ee83e76
commit
d376d08438
@@ -0,0 +1,5 @@
|
||||
package org.jetbrains.ring
|
||||
|
||||
class konan {
|
||||
annotation class ThreadLocal
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import kotlin.system.measureNanoTime
|
||||
//-----------------------------------------------------------------------------//
|
||||
|
||||
class Blackhole {
|
||||
@konan.ThreadLocal
|
||||
companion object {
|
||||
var consumer = 0
|
||||
fun consume(value: Any) {
|
||||
@@ -32,6 +33,7 @@ class Blackhole {
|
||||
//-----------------------------------------------------------------------------//
|
||||
|
||||
class Random() {
|
||||
@konan.ThreadLocal
|
||||
companion object {
|
||||
var seedInt = 0
|
||||
fun nextInt(boundary: Int = 100): Int {
|
||||
|
||||
Reference in New Issue
Block a user