Marked global mutable state in the benchmark as thread local

This commit is contained in:
Sergey Bogolepov
2018-07-18 18:23:42 +07:00
committed by Sergey Bogolepov
parent d04ee83e76
commit d376d08438
2 changed files with 7 additions and 0 deletions
@@ -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 {