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 {
|
class Blackhole {
|
||||||
|
@konan.ThreadLocal
|
||||||
companion object {
|
companion object {
|
||||||
var consumer = 0
|
var consumer = 0
|
||||||
fun consume(value: Any) {
|
fun consume(value: Any) {
|
||||||
@@ -32,6 +33,7 @@ class Blackhole {
|
|||||||
//-----------------------------------------------------------------------------//
|
//-----------------------------------------------------------------------------//
|
||||||
|
|
||||||
class Random() {
|
class Random() {
|
||||||
|
@konan.ThreadLocal
|
||||||
companion object {
|
companion object {
|
||||||
var seedInt = 0
|
var seedInt = 0
|
||||||
fun nextInt(boundary: Int = 100): Int {
|
fun nextInt(boundary: Int = 100): Int {
|
||||||
|
|||||||
Reference in New Issue
Block a user