summaryrefslogtreecommitdiff
path: root/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-03-04 05:22:57 +0000
committerPaul Phillips <paulp@improving.org>2010-03-04 05:22:57 +0000
commit34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec (patch)
treeb2ae69f2731acde0ec4b921cf2e1a73295ea3250 /src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala
parent65520ac86f5362bfa438c0b9e1a84f1f558e2618 (diff)
downloadscala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.tar.gz
scala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.tar.bz2
scala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.zip
A few yards short of the goal posts attempt at ...
A few yards short of the goal posts attempt at making our usage of Throwable subclasses more consistent. This patch eliminates a lot of ad hoc Exception/Error/etc. creation and various arbitrary choices are rendered slightly less arbitrary. From now on let's try not to use the word "Exception" or "Error" in the names of Throwable subclasses unless they actually derive (and make sense to derive) from Exception or Error. Review by community.
Diffstat (limited to 'src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala')
-rw-r--r--src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala b/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala
index ff74d0bc8b..3687138e0e 100644
--- a/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala
+++ b/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala
@@ -112,7 +112,7 @@ class ResizableThreadPoolScheduler(protected val terminate: Boolean,
}
if (terminating)
- throw new QuitException
+ throw new QuitControl
if (!suspending) {
gc()
@@ -129,19 +129,19 @@ class ResizableThreadPoolScheduler(protected val terminate: Boolean,
Debug.info(this+": corePoolSize = "+coreSize+", maxPoolSize = "+maxSize)
terminating = true
- throw new QuitException
+ throw new QuitControl
}
}
} else {
drainedTasks = executor.shutdownNow()
Debug.info(this+": drained "+drainedTasks.size()+" tasks")
terminating = true
- throw new QuitException
+ throw new QuitControl
}
} // sync
}
} catch {
- case _: QuitException =>
+ case _: QuitControl =>
executor.shutdown()
// allow thread to exit
}