diff options
author | Philipp Haller <hallerp@gmail.com> | 2009-08-03 15:56:44 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2009-08-03 15:56:44 +0000 |
commit | ac89702827559cab8835edecb35cc09a1ca3fe10 (patch) | |
tree | 7d8b01c12aeb8f42192ac68cce3289b3a4078310 /src/library/scala/concurrent/ManagedBlocker.scala | |
parent | cf7a2f64f1357dcfa8ecf78ae8f29880c9fab214 (diff) | |
download | scala-ac89702827559cab8835edecb35cc09a1ca3fe10.tar.gz scala-ac89702827559cab8835edecb35cc09a1ca3fe10.tar.bz2 scala-ac89702827559cab8835edecb35cc09a1ca3fe10.zip |
Added the scala.concurrent.TaskRunner and scala...
Added the scala.concurrent.TaskRunner and
scala.concurrent.AsyncInvokable abstractions with corresponding
refactorings in scala.actors and scala.concurrent.
Diffstat (limited to 'src/library/scala/concurrent/ManagedBlocker.scala')
-rw-r--r-- | src/library/scala/concurrent/ManagedBlocker.scala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/library/scala/concurrent/ManagedBlocker.scala b/src/library/scala/concurrent/ManagedBlocker.scala new file mode 100644 index 0000000000..c77f97285e --- /dev/null +++ b/src/library/scala/concurrent/ManagedBlocker.scala @@ -0,0 +1,24 @@ +package scala.concurrent + +/** The <code>ManagedBlocker</code> trait... + * + * @author Philipp Haller + */ +trait ManagedBlocker { + + /** + * Possibly blocks the current thread, for example waiting for + * a lock or condition. + * @return true if no additional blocking is necessary (i.e., + * if isReleasable would return true). + * @throws InterruptedException if interrupted while waiting + * (the method is not required to do so, but is allowed to). + */ + def block(): Boolean + + /** + * Returns true if blocking is unnecessary. + */ + def isReleasable: Boolean + +} |