diff options
author | Philipp Haller <hallerp@gmail.com> | 2007-01-17 18:04:40 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2007-01-17 18:04:40 +0000 |
commit | 01f4bb38e9e2ebf80a819eb8cccdff171f1193ed (patch) | |
tree | 81dd2a58222cf38cf548fbe375bf08d92f9a9976 | |
parent | 2bd3ff37dfe7bfe454460459377879722f6b20a6 (diff) | |
download | scala-01f4bb38e9e2ebf80a819eb8cccdff171f1193ed.tar.gz scala-01f4bb38e9e2ebf80a819eb8cccdff171f1193ed.tar.bz2 scala-01f4bb38e9e2ebf80a819eb8cccdff171f1193ed.zip |
Fixes in shutdown methods of JDK5Scheduler and ...
Fixes in shutdown methods of JDK5Scheduler and TickedScheduler.
-rw-r--r-- | src/actors/scala/actors/JDK5Scheduler.scala | 5 | ||||
-rw-r--r-- | src/actors/scala/actors/TickedScheduler.scala | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/actors/scala/actors/JDK5Scheduler.scala b/src/actors/scala/actors/JDK5Scheduler.scala index 825e5ddfd7..f3496585fb 100644 --- a/src/actors/scala/actors/JDK5Scheduler.scala +++ b/src/actors/scala/actors/JDK5Scheduler.scala @@ -152,8 +152,11 @@ class JDK5Scheduler(initCoreSize: int, maxSize: int) extends Thread with ISchedu /** Shuts down all idle worker threads. */ def shutdown(): unit = synchronized { + Debug.info("Shutting down scheduler...") terminating = true - executor.shutdown() + // terminate timer thread + TimerThread.t.interrupt() + Console.println("threads used: "+coreSize) } } diff --git a/src/actors/scala/actors/TickedScheduler.scala b/src/actors/scala/actors/TickedScheduler.scala index 4effcb2d75..63651cff40 100644 --- a/src/actors/scala/actors/TickedScheduler.scala +++ b/src/actors/scala/actors/TickedScheduler.scala @@ -158,14 +158,13 @@ class TickedScheduler extends Thread with IScheduler { */ def shutdown(): unit = synchronized { terminating = true - val idleThreads = idle.elements while (idleThreads.hasNext) { val worker = idleThreads.next worker.running = false worker.interrupt() - // caused deadlock (tries to acquire lock of worker) - //worker.join() } + // terminate timer thread + TimerThread.t.interrupt() } } |