diff options
author | Philipp Haller <hallerp@gmail.com> | 2009-10-26 21:01:12 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2009-10-26 21:01:12 +0000 |
commit | f3068614fb38fc08be54ac1179a1cfec52b8b13b (patch) | |
tree | 76ee219f209559d900b17682e29c9aaf9b3d73ab /src/actors/scala | |
parent | 63b1fd9be6c8c9e28092d775037c695af4b264e3 (diff) | |
download | scala-f3068614fb38fc08be54ac1179a1cfec52b8b13b.tar.gz scala-f3068614fb38fc08be54ac1179a1cfec52b8b13b.tar.bz2 scala-f3068614fb38fc08be54ac1179a1cfec52b8b13b.zip |
Second half of fix and tests for #1518.
Diffstat (limited to 'src/actors/scala')
-rw-r--r-- | src/actors/scala/actors/Actor.scala | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/actors/scala/actors/Actor.scala b/src/actors/scala/actors/Actor.scala index 553019932d..b563104f41 100644 --- a/src/actors/scala/actors/Actor.scala +++ b/src/actors/scala/actors/Actor.scala @@ -10,7 +10,6 @@ package scala.actors -import scala.compat.Platform import scala.util.control.ControlException import java.util.{Timer, TimerTask} import java.util.concurrent.{ExecutionException, Callable} @@ -439,7 +438,12 @@ trait Actor extends AbstractActor with ReplyReactor with ReplyableActor { var done = false while (!done) { - val qel = mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => f.isDefinedAt(m)) + val qel = mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => { + senders = replyTo :: senders + val matches = f.isDefinedAt(m) + senders = senders.tail + matches + }) if (null eq qel) { synchronized { // in mean time new stuff might have arrived @@ -496,7 +500,12 @@ trait Actor extends AbstractActor with ReplyReactor with ReplyableActor { var done = false while (!done) { - val qel = mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => f.isDefinedAt(m)) + val qel = mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => { + senders = replyTo :: senders + val matches = f.isDefinedAt(m) + senders = senders.tail + matches + }) if (null eq qel) { val todo = synchronized { // in mean time new stuff might have arrived @@ -592,7 +601,10 @@ trait Actor extends AbstractActor with ReplyReactor with ReplyableActor { var done = false while (!done) { - val qel = mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => f.isDefinedAt(m)) + val qel = mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => { + senders = List(replyTo) + f.isDefinedAt(m) + }) if (null eq qel) { val todo = synchronized { // in mean time new stuff might have arrived |