Skip to content

Commit

Permalink
Null pointer check and disabled optimization.
Browse files Browse the repository at this point in the history
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/branches/2.7.x@17908 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
  • Loading branch information
phaller committed May 29, 2009
1 parent 860e871 commit 472cb9d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/actors/scala/actors/Scheduler.scala
Expand Up @@ -63,31 +63,37 @@ object Scheduler extends IScheduler {
s
}
//Actor.timer = new java.util.Timer
while (!tasks.isEmpty()) {
sched.execute(tasks.take().asInstanceOf[FJTask])
if (tasks ne null) {
while (!tasks.isEmpty()) {
sched.execute(tasks.take().asInstanceOf[FJTask])
}
tasks = null
}
tasks = null
}

def execute(task: Runnable) {
/*
val t = currentThread
if (t.isInstanceOf[FJTaskRunner]) {
val tr = t.asInstanceOf[FJTaskRunner]
tr.push(new FJTask {
def run() { task.run() }
})
} else
*/
sched execute task
}

def execute(fun: => Unit) {
/*
val t = currentThread
if (t.isInstanceOf[FJTaskRunner]) {
val tr = t.asInstanceOf[FJTaskRunner]
tr.push(new FJTask {
def run() { fun }
})
} else
*/
sched execute { fun }
}

Expand Down

0 comments on commit 472cb9d

Please sign in to comment.