35 pthread_attr_t *attr =
new pthread_attr_t;
37 pthread_attr_init(attr);
41 Warning(
"Run",
"Affinity setting not yet implemented on MacOS");
45 CPU_SET(affinity, &cpuset);
46 pthread_attr_setaffinity_np(attr,
sizeof(cpu_set_t), &cpuset);
51 det = (th->
fDetached) ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE;
53 pthread_attr_setdetachstate(attr, det);
57 const size_t requiredStackSize = 1024*1024*2;
59 if (!pthread_attr_getstacksize(attr, &stackSize)
60 && stackSize < requiredStackSize) {
61 pthread_attr_setstacksize(attr, requiredStackSize);
66 pthread_attr_destroy(attr);
80 return pthread_join((pthread_t) th->
fId, ret);
99 return pthread_cancel((pthread_t) th->
fId);
108 return pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, 0);
117 return pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
127 return pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
137 return pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, 0);
146 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &istate);
147 pthread_testcancel();
148 pthread_setcancelstate(istate, 0);
159 if (!
free)
Error(
"CleanUpPush",
"cleanup rountine = 0");
173 if (!
l->fRoutine)
Error(
"CleanUpPop",
"cleanup routine = 0");
174 if (exe &&
l->fRoutine) ((
void (*)(
void*))(
l->fRoutine))(
l->fArgument);
175 *
main =
l->fNext;
delete l;
195 return (
Long_t) pthread_self();
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
TPosixThreadCleanUp(void **main, void *routine, void *arg)
cleanup function
TPosixThreadCleanUp * fNext
virtual Int_t SetCancelDeferred()
Set the cancellation response type of the calling thread to deferred, i.e.
virtual Int_t SetCancelOff()
Turn off the cancellation state of the calling thread.
virtual Int_t CleanUp(void **main)
Default thread cleanup routine.
virtual Int_t Kill(TThread *th)
Cancellation is the mechanism by which a thread can terminate the execution of another thread.
virtual Int_t SetCancelOn()
Turn on the cancellation state of the calling thread.
virtual Int_t SetCancelAsynchronous()
Set the cancellation response type of the calling thread to asynchronous, i.e.
virtual Int_t CancelPoint()
Introduce an explicit cancellation point. Returns 0.
virtual Int_t Join(TThread *th, void **ret)
Join suspends the execution of the calling thread until the thread identified by th terminates,...
virtual Int_t CleanUpPush(void **main, void *free, void *arg)
Add thread cleanup function.
virtual Int_t Run(TThread *th, const int affinity=-1)
Create a pthread.
virtual Int_t Exit(void *ret)
Terminates the execution of the calling thread. Return 0.
virtual Long_t SelfId()
Return the thread identifier for the calling thread.
virtual Int_t CleanUpPop(void **main, Int_t exe)
Pop thread cleanup function from stack.
static void * Function(void *ptr)
Static method which is called by the system thread function and which in turn calls the actual user f...