summaryrefslogtreecommitdiff
path: root/sources/scala/concurrent/SyncVar.scala
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2004-04-05 10:03:55 +0000
committermihaylov <mihaylov@epfl.ch>2004-04-05 10:03:55 +0000
commit784644a91989a7e1183bfa313588d5a602f7388b (patch)
tree728f251a971a3d037d9a6ae22847f2d7eefa681f /sources/scala/concurrent/SyncVar.scala
parenta28216b0e1c9f409a4d655c41ff0831ff498e72b (diff)
downloadscala-784644a91989a7e1183bfa313588d5a602f7388b.tar.gz
scala-784644a91989a7e1183bfa313588d5a602f7388b.tar.bz2
scala-784644a91989a7e1183bfa313588d5a602f7388b.zip
- Synchronized the isSet method to guard agains...
- Synchronized the isSet method to guard against the weak guarantees of the Java Memory Model
Diffstat (limited to 'sources/scala/concurrent/SyncVar.scala')
-rw-r--r--sources/scala/concurrent/SyncVar.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/scala/concurrent/SyncVar.scala b/sources/scala/concurrent/SyncVar.scala
index ec3fd281e2..0e1b9fd38c 100644
--- a/sources/scala/concurrent/SyncVar.scala
+++ b/sources/scala/concurrent/SyncVar.scala
@@ -26,12 +26,12 @@ class SyncVar[a] {
notifyAll()
}
- def isSet: Boolean =
+ def isSet: Boolean = synchronized {
isDefined;
+ }
def unset = synchronized {
isDefined = false
}
}
-