diff options
author | Paradox <none@none> | 2009-02-17 20:10:49 -0600 |
---|---|---|
committer | Paradox <none@none> | 2009-02-17 20:10:49 -0600 |
commit | 3931b802f1b8b890a615e5b2a4c0ed70407468d7 (patch) | |
tree | b1386a80454be7ba341d4fcd4f87c133d9af95a7 /dep/src/zthread/SynchronousExecutor.cxx | |
parent | 14234c86fa4f1b31436a0289cdac5f92ab430804 (diff) |
Yet more tabs to spaces
--HG--
branch : trunk
Diffstat (limited to 'dep/src/zthread/SynchronousExecutor.cxx')
-rw-r--r-- | dep/src/zthread/SynchronousExecutor.cxx | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/dep/src/zthread/SynchronousExecutor.cxx b/dep/src/zthread/SynchronousExecutor.cxx index 0dc75b5f676..da49797ee94 100644 --- a/dep/src/zthread/SynchronousExecutor.cxx +++ b/dep/src/zthread/SynchronousExecutor.cxx @@ -24,12 +24,12 @@ namespace ZThread { - SynchronousExecutor::SynchronousExecutor() + SynchronousExecutor::SynchronousExecutor() : _canceled(false) {} SynchronousExecutor::~SynchronousExecutor() { } - + void SynchronousExecutor::cancel() { Guard<Mutex> g(_lock); @@ -38,41 +38,41 @@ namespace ZThread { } bool SynchronousExecutor::isCanceled() { - + Guard<Mutex> g(_lock); return _canceled; - + } void SynchronousExecutor::interrupt() { } void SynchronousExecutor::execute(const Task& task) { - - // Canceled Executors will not accept new tasks, quick + + // Canceled Executors will not accept new tasks, quick // check to avoid excessive locking in the canceled state - if(_canceled) + if(_canceled) throw Cancellation_Exception(); - + Guard<Mutex> g(_lock); - + if(_canceled) // Double check throw Cancellation_Exception(); - + // Run the task. Task(task)->run(); - - } + + } void SynchronousExecutor::wait() { - + if(Thread::interrupted()) throw Interrupted_Exception(); - + Guard<Mutex> g(_lock); - + } - + /** * @see Executor::wait(unsigned long) */ @@ -80,11 +80,11 @@ namespace ZThread { if(Thread::interrupted()) throw Interrupted_Exception(); - + Guard<Mutex> g(_lock); return true; - + } - - + + } |