summaryrefslogtreecommitdiff
path: root/src/actors
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2006-11-13 14:59:18 +0000
committermihaylov <mihaylov@epfl.ch>2006-11-13 14:59:18 +0000
commitf3047df95f007d48d0049ff78448d27045b20445 (patch)
tree47e848f238fad00e117a4244ec69c229945301df /src/actors
parentac255eaf858397ee14b8ffafd8066b100d5e6be4 (diff)
downloadscala-f3047df95f007d48d0049ff78448d27045b20445.tar.gz
scala-f3047df95f007d48d0049ff78448d27045b20445.tar.bz2
scala-f3047df95f007d48d0049ff78448d27045b20445.zip
Replaced == null()eq null(ne null)
Diffstat (limited to 'src/actors')
-rw-r--r--src/actors/scala/actors/Actor.scala8
-rw-r--r--src/actors/scala/actors/Channel.scala6
-rw-r--r--src/actors/scala/actors/Scheduler.scala6
3 files changed, 10 insertions, 10 deletions
diff --git a/src/actors/scala/actors/Actor.scala b/src/actors/scala/actors/Actor.scala
index af2b477ccf..419f7f30fb 100644
--- a/src/actors/scala/actors/Actor.scala
+++ b/src/actors/scala/actors/Actor.scala
@@ -36,7 +36,7 @@ object Actor {
def self: Actor = synchronized {
val t = currentThread
var a = selfs.get(t).asInstanceOf[Actor]
- if (a == null) {
+ if (a eq null) {
a = new ActorProxy(t)
selfs.put(t, a)
}
@@ -303,7 +303,7 @@ trait Actor extends OutputChannel[Any] {
private var rc: Channel[Any] = null
private[actors] def reply: Channel[Any] = {
- if (rc == null) {
+ if (rc eq null) {
rc = new Channel[Any]
rc.receiver = this
}
@@ -350,12 +350,12 @@ trait Actor extends OutputChannel[Any] {
private[actors] var timeoutPending = false
private[actors] def scheduleActor(f: PartialFunction[Any, Unit], msg: Any) =
- if (f == null && continuation == null) {
+ if ((f eq null) && (continuation eq null)) {
// do nothing (timeout is handled instead)
}
else {
val task = new ActorTask(this,
- if (f == null) continuation else f,
+ if (f eq null) continuation else f,
msg)
Scheduler.execute(task)
}
diff --git a/src/actors/scala/actors/Channel.scala b/src/actors/scala/actors/Channel.scala
index 20e1cd0f49..85949db53a 100644
--- a/src/actors/scala/actors/Channel.scala
+++ b/src/actors/scala/actors/Channel.scala
@@ -50,7 +50,7 @@ class Channel[Msg] extends InputChannel[Msg] with OutputChannel[Msg] {
private def send(msg: Msg, sender: Actor) = receiver.synchronized {
receiver.tick()
- if (waitingFor(msg) && ((waitingForSender == null) ||
+ if (waitingFor(msg) && ((waitingForSender eq null) ||
(waitingForSender == sender))) {
received = msg
receiver.pushSender(sender)
@@ -215,7 +215,7 @@ class Channel[Msg] extends InputChannel[Msg] with OutputChannel[Msg] {
else synchronized {
isSuspended = true
receiver.suspendActorFor(msec)
- if (received == null)
+ if (received eq null)
if (f.isDefinedAt(TIMEOUT)) {
isSuspended = false
val result = f(TIMEOUT)
@@ -240,7 +240,7 @@ class Channel[Msg] extends InputChannel[Msg] with OutputChannel[Msg] {
received = null
receiver.suspendActorFor(msec)
Debug.info("received: "+received)
- if (received == null) {
+ if (received eq null) {
Debug.info("no message received after "+msec+" millis")
if (f.isDefinedAt(TIMEOUT)) {
Debug.info("executing TIMEOUT action")
diff --git a/src/actors/scala/actors/Scheduler.scala b/src/actors/scala/actors/Scheduler.scala
index 50d7a2db39..314f1e2311 100644
--- a/src/actors/scala/actors/Scheduler.scala
+++ b/src/actors/scala/actors/Scheduler.scala
@@ -372,7 +372,7 @@ class QuitException extends Throwable {
* <p>
* A worker thread enters the idle queue of the scheduler when
* <code>getTask</code> returns <code>null</code>. Then it will also stay
- * in the while-loop W (<code>while (task == null)</code>) until
+ * in the while-loop W (<code>while (task eq null)</code>) until
* <code>task</code> becomes non-null. The only way this can happen is
* through a call of <code>execute</code> by the scheduler. Before every
* call of <code>execute</code> the worker thread is removed from the idle
@@ -401,7 +401,7 @@ class WorkerThread(sched: IScheduler) extends Thread {
override def run(): Unit =
try {
while (running) {
- if (task != null) {
+ if (task ne null) {
try {
task.run()
} catch {
@@ -412,7 +412,7 @@ class WorkerThread(sched: IScheduler) extends Thread {
this.synchronized {
task = sched.getTask(this)
- while (task == null) {
+ while (task eq null) {
try {
wait()
} catch {