diff options
author | megamage <none@none> | 2009-02-18 11:36:19 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-18 11:36:19 -0600 |
commit | 31637d4aac6ae2081ccb3db976cab17936019f1a (patch) | |
tree | a0e098d4afafaddcb901486d00da1563ecd628b9 /dep/src/zthread/macos/ThreadOps.cxx | |
parent | 017f309b5b5b981b6edfe0ae071971d513828a20 (diff) | |
parent | 7bff1c1d60b78ba78f2ab0a9c67bdde80427ea30 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'dep/src/zthread/macos/ThreadOps.cxx')
-rw-r--r-- | dep/src/zthread/macos/ThreadOps.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dep/src/zthread/macos/ThreadOps.cxx b/dep/src/zthread/macos/ThreadOps.cxx index 6a1a4106877..ddb380992b0 100644 --- a/dep/src/zthread/macos/ThreadOps.cxx +++ b/dep/src/zthread/macos/ThreadOps.cxx @@ -27,25 +27,25 @@ namespace ZThread { -const ThreadOps ThreadOps::INVALID(0); +const ThreadOps ThreadOps::INVALID(0); + +ThreadOps::ThreadOps() : _queue(0), _tid(0) { -ThreadOps::ThreadOps() : _queue(0), _tid(0) { - if(MPCreateQueue(&_queue) != noErr) throw Initialization_Exception(); } ThreadOps::~ThreadOps() throw() { - + if(_queue != 0) { OSStatus status = MPDeleteQueue(_queue); - if(status != noErr) + if(status != noErr) assert(0); } - + } bool ThreadOps::join(ThreadOps* ops) { @@ -56,7 +56,7 @@ bool ThreadOps::join(ThreadOps* ops) { OSStatus status = MPWaitOnQueue(ops->_queue, NULL, NULL, NULL, kDurationForever); return status == noErr; - + } bool ThreadOps::yield() { @@ -91,13 +91,13 @@ OSStatus ThreadOps::_dispatch(void *arg) { // Run the task from the correct context task->run(); - + // Exit the thread MPExit(noErr); return noErr; } - + } // namespace ZThread |