diff options
author | mihaylov <mihaylov@epfl.ch> | 2006-02-21 10:43:10 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2006-02-21 10:43:10 +0000 |
commit | f5f37e4062dd2757e8b2c87560ea917d39b0f255 (patch) | |
tree | ae07725ce22a478c14353a236eb177343c562615 | |
parent | 5380d49e4e63bab0870bd323d012b298553b2b39 (diff) | |
download | scala-f5f37e4062dd2757e8b2c87560ea917d39b0f255.tar.gz scala-f5f37e4062dd2757e8b2c87560ea917d39b0f255.tar.bz2 scala-f5f37e4062dd2757e8b2c87560ea917d39b0f255.zip |
Turned TIMEOUT into a case object.
-rw-r--r-- | src/library/scala/concurrent/MailBox.scala | 4 | ||||
-rw-r--r-- | src/library/scala/concurrent/TIMEOUT.scala | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/concurrent/MailBox.scala b/src/library/scala/concurrent/MailBox.scala index 4463071f2e..4162d34fc3 100644 --- a/src/library/scala/concurrent/MailBox.scala +++ b/src/library/scala/concurrent/MailBox.scala @@ -25,13 +25,13 @@ class MailBox extends AnyRef with ListQueueCreator { def isDefinedAt(msg: Message) = receiver.isDefinedAt(msg); def receive(): a = synchronized { - if (msg == null) wait(); + while (msg == null) wait(); receiver(msg) } def receiveWithin(msec: long): a = synchronized { if (msg == null) wait(msec); - receiver(if (msg != null) msg else TIMEOUT()) + receiver(if (msg != null) msg else TIMEOUT) } } diff --git a/src/library/scala/concurrent/TIMEOUT.scala b/src/library/scala/concurrent/TIMEOUT.scala index d665fdf649..681fc9a66b 100644 --- a/src/library/scala/concurrent/TIMEOUT.scala +++ b/src/library/scala/concurrent/TIMEOUT.scala @@ -9,4 +9,4 @@ package scala.concurrent; -case class TIMEOUT(); +case object TIMEOUT; |