aboutsummaryrefslogtreecommitdiff
path: root/dep/src/zthread/macos/ThreadOps.cxx
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-17 21:54:48 -0600
committermegamage <none@none>2009-02-17 21:54:48 -0600
commit89ba43ef3e3f8d4b563c9e8efaf06bf7f7b44065 (patch)
treefbe73c4d529f195d51b8ca4b62be8443da80becf /dep/src/zthread/macos/ThreadOps.cxx
parentbe53cfe1044d7e913c4c11a7245e2d2846826363 (diff)
parent3931b802f1b8b890a615e5b2a4c0ed70407468d7 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'dep/src/zthread/macos/ThreadOps.cxx')
-rw-r--r--dep/src/zthread/macos/ThreadOps.cxx18
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