36 HANDLE hHandle = CreateThread(0, 0,
38 th, 0, (DWORD*)&dwThreadId);
40 Warning(
"Run",
"Affinity setting not yet implemented on Win32");
42 ::CloseHandle(hHandle);
49 return hHandle ? 0 : EINVAL;
58 DWORD
R = WaitForSingleObject((HANDLE)th->
fHandle, INFINITE);
60 if ( (
R == WAIT_OBJECT_0) || (
R == WAIT_ABANDONED) ) {
64 if (
R == WAIT_TIMEOUT )
84 if (TerminateThread((HANDLE)th->
fHandle,0)) {
95 if (!
free) fprintf(stderr,
"CleanUpPush ***ERROR*** Routine=0\n");
104 if (!*
main)
return 1;
106 if (!
l->fRoutine) fprintf(stderr,
"CleanUpPop ***ERROR*** Routine=0\n");
107 if (exe &&
l->fRoutine) ((void (*)(
void*))(
l->fRoutine))(
l->fArgument);
108 *
main =
l->fNext;
delete l;
116 fprintf(stderr,
" CleanUp %zx\n",(
size_t)*
main);
126 return (
Long_t)::GetCurrentThreadId();
134 Warning(
"SetCancelOff",
"Not implemented on Win32");
143 Warning(
"SetCancelOn",
"Not implemented on Win32");
152 Warning(
"SetCancelAsynchronous",
"Not implemented on Win32");
161 Warning(
"SetCancelDeferred",
"Not implemented on Win32");
170 Warning(
"CancelPoint",
"Not implemented on Win32");
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
<div class="legacybox"><h2>Legacy Code</h2> TThread is a legacy interface: there will be no bug fixes...
static void * Function(void *ptr)
Static method which is called by the system thread function and which in turn calls the actual user f...
TWin32ThreadCleanUp(void **main, void *routine, void *arg)
TWin32ThreadCleanUp * fNext
Int_t SetCancelOff() override
Int_t CleanUpPop(void **main, Int_t exe) override
Int_t Exit(void *ret) override
Exit the thread.
Int_t SetCancelOn() override
Int_t SetCancelDeferred() override
Int_t CleanUp(void **main) override
Long_t SelfId() override
Return the current thread's ID.
Int_t SetCancelAsynchronous() override
Int_t CancelPoint() override
Int_t CleanUpPush(void **main, void *free, void *arg) override
Int_t Kill(TThread *th) override
This is a somewhat dangerous function; it's not suggested to Stop() threads a lot.
Int_t Join(TThread *th, void **ret) override
Wait for specified thread execution (if any) to complete (like pthread_join).
Int_t Run(TThread *th, const int affinity=-1) override
Win32 threads – spawn new thread (like pthread_create).