diff options
author | Philipp Haller <hallerp@gmail.com> | 2006-08-11 17:29:25 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2006-08-11 17:29:25 +0000 |
commit | a035658a136e90dc31b4961550c5f172e0a229e2 (patch) | |
tree | b2ae28bb6f78dc17962c9820e5b59041c22cc21a | |
parent | 33a926256379066b0fcf24a41ffcf23ac243e6dc (diff) | |
download | scala-a035658a136e90dc31b4961550c5f172e0a229e2.tar.gz scala-a035658a136e90dc31b4961550c5f172e0a229e2.tar.bz2 scala-a035658a136e90dc31b4961550c5f172e0a229e2.zip |
Changed TIMEOUT into case object.
-rw-r--r-- | src/actors/scala/actors/TIMEOUT.scala | 2 | ||||
-rw-r--r-- | src/actors/scala/actors/multi/MailBox.scala | 8 | ||||
-rw-r--r-- | src/actors/scala/actors/single/MailBox.scala | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/actors/scala/actors/TIMEOUT.scala b/src/actors/scala/actors/TIMEOUT.scala index 63a4ad322f..ea2889be0e 100644 --- a/src/actors/scala/actors/TIMEOUT.scala +++ b/src/actors/scala/actors/TIMEOUT.scala @@ -8,4 +8,4 @@ package scala.actors -case class TIMEOUT() +case object TIMEOUT diff --git a/src/actors/scala/actors/multi/MailBox.scala b/src/actors/scala/actors/multi/MailBox.scala index 52aa0a7486..529f03a747 100644 --- a/src/actors/scala/actors/multi/MailBox.scala +++ b/src/actors/scala/actors/multi/MailBox.scala @@ -61,9 +61,9 @@ trait MailBox { else msg match { case Signal() => - if (!contDefinedAt(TIMEOUT())) die() + if (!contDefinedAt(TIMEOUT)) die() else - scheduleContinuation(TIMEOUT()) + scheduleContinuation(TIMEOUT) case _ => if (!contDefinedAt(msg)) sent += msg @@ -130,9 +130,9 @@ trait MailBox { case None => // if timeout == 0 then execute timeout action if specified (see Erlang book) if (msec == 0) { - if (f.isDefinedAt(TIMEOUT())) { + if (f.isDefinedAt(TIMEOUT)) { continuation = f - scheduleContinuation(TIMEOUT()) + scheduleContinuation(TIMEOUT) } die() } else { diff --git a/src/actors/scala/actors/single/MailBox.scala b/src/actors/scala/actors/single/MailBox.scala index 3e8116a794..e46503c472 100644 --- a/src/actors/scala/actors/single/MailBox.scala +++ b/src/actors/scala/actors/single/MailBox.scala @@ -54,10 +54,10 @@ trait MailBox { if (timeoutEnabled && (System.currentTimeMillis() - timeInitial > duration)) timeoutOccurred = true - if (timeoutOccurred && !contDefinedAt(TIMEOUT())) + if (timeoutOccurred && !contDefinedAt(TIMEOUT)) die() else { - if (timeoutOccurred) message = TIMEOUT() + if (timeoutOccurred) message = TIMEOUT if (contDefinedAt(message)) { // we exit receive, so reset timeoutEnabled @@ -119,8 +119,8 @@ trait MailBox { case None => // if timeout == 0 then execute timeout action if specified (see Erlang book) if (duration == 0) { - if (f.isDefinedAt(TIMEOUT())) - f(TIMEOUT()) + if (f.isDefinedAt(TIMEOUT)) + f(TIMEOUT) die() } else { |