[StoreStore]
<volatile_store>
[StoreLoad]
<volatile_load>
[LoadLoad|LoadStore]
[StoreStore]
<volatile_store>
[StoreLoad]
<volatile_load>
[LoadLoad|LoadStore]
| import java.io.File | |
| import java.lang.Math.{pow, sqrt} | |
| import scala.annotation.tailrec | |
| import scala.util.Random | |
| case class Point(x: Double, y: Double, z: Double) { | |
| def distanceTo(that: Point) = sqrt(pow(this.x - that.x, 2) + pow(this.y - that.y, 2) + pow(this.z - that.z, 2)) | |
| def sum(that: Point) = Point(this.x + that.x, this.y + that.y, this.z + that.z) |
| # | |
| # Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software |
| # | |
| # Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software |
| import org.junit.Test; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import java.util.concurrent.CountDownLatch; | |
| import static java.util.concurrent.TimeUnit.SECONDS; | |
| import static org.junit.Assert.assertTrue; | |
| public class HashMapThreadSafetyTest { |