diff options
author | Philipp Haller <hallerp@gmail.com> | 2009-01-22 16:43:42 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2009-01-22 16:43:42 +0000 |
commit | d7839e8a6dc23049f9b0cc979c5e2ba54ce07a5a (patch) | |
tree | 81bf2626f4dcd2c23e12bdc1295872027ce7a0f8 /src/actors/scala/actors/Scheduler.scala | |
parent | 45aed61ae5be6da371f4724df24057c72ce0f644 (diff) | |
download | scala-d7839e8a6dc23049f9b0cc979c5e2ba54ce07a5a.tar.gz scala-d7839e8a6dc23049f9b0cc979c5e2ba54ce07a5a.tar.bz2 scala-d7839e8a6dc23049f9b0cc979c5e2ba54ce07a5a.zip |
ActorGC is no longer a global object; each sche...
ActorGC is no longer a global object; each scheduler provides its own
ActorGC instance. Prepares for resolution of #1405.
Diffstat (limited to 'src/actors/scala/actors/Scheduler.scala')
-rw-r--r-- | src/actors/scala/actors/Scheduler.scala | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/actors/scala/actors/Scheduler.scala b/src/actors/scala/actors/Scheduler.scala index bc2c093c0e..77e13a5fcc 100644 --- a/src/actors/scala/actors/Scheduler.scala +++ b/src/actors/scala/actors/Scheduler.scala @@ -47,7 +47,7 @@ object Scheduler extends IScheduler { if (sched.isInstanceOf[FJTaskScheduler2]) { val fjts = sched.asInstanceOf[FJTaskScheduler2] tasks = fjts.snapshot() - pendingCount = ActorGC.getPendingCount + pendingCount = actorGC.getPendingCount fjts.shutdown() } else error("snapshot operation not supported.") @@ -58,7 +58,7 @@ object Scheduler extends IScheduler { def restart(): Unit = synchronized { sched = { val s = new FJTaskScheduler2 - ActorGC.setPendingCount(pendingCount) + actorGC.setPendingCount(pendingCount) s.start() s } @@ -93,6 +93,12 @@ object Scheduler extends IScheduler { def shutdown() = sched.shutdown() + /** The <code>ActorGC</code> instance that keeps track of the + * live actor objects that are managed by <code>this</code> + * scheduler. + */ + def actorGC: ActorGC = sched.actorGC + def onLockup(handler: () => Unit) = sched.onLockup(handler) def onLockup(millis: Int)(handler: () => Unit) = sched.onLockup(millis)(handler) def printActorDump = sched.printActorDump @@ -129,6 +135,12 @@ trait IScheduler { */ def shutdown(): Unit + /** The <code>ActorGC</code> instance that keeps track of the + * live actor objects that are managed by <code>this</code> + * <code>IScheduler</code> instance. + */ + def actorGC: ActorGC + def onLockup(handler: () => Unit): Unit def onLockup(millis: Int)(handler: () => Unit): Unit def printActorDump: Unit @@ -160,6 +172,12 @@ class SingleThreadedScheduler extends IScheduler { def shutdown() {} + /** The <code>ActorGC</code> instance that keeps track of the + * live actor objects that are managed by <code>this</code> + * scheduler. + */ + val actorGC: ActorGC = new ActorGC + def onLockup(handler: () => Unit) {} def onLockup(millis: Int)(handler: () => Unit) {} def printActorDump {} |