00001 #ifndef COIN_SBTHREAD_H
00002 #define COIN_SBTHREAD_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <Inventor/SbBasic.h>
00028 #include <Inventor/C/threads/thread.h>
00029
00030 class SbThread {
00031 public:
00032 static SbThread * create(void *(*func)(void *), void * closure) {
00033 return new SbThread(cc_thread_construct(func, closure));
00034 }
00035 static void destroy(SbThread * thread) {
00036 cc_thread_destruct(thread->thread);
00037 delete thread;
00038 }
00039
00040 SbBool join(void ** retval = 0L) {
00041 return cc_thread_join(this->thread, retval) == CC_OK;
00042 }
00043 static SbBool join(SbThread * thread, void ** retval = 0L) {
00044 return cc_thread_join(thread->thread, retval) == CC_OK;
00045 }
00046
00047 protected:
00048 SbThread(cc_thread * thread) { this->thread = thread; }
00049 ~SbThread(void) {}
00050
00051 private:
00052 cc_thread * thread;
00053 };
00054
00055 #endif // !COIN_SBTHREAD_H