Thread::Run::Run(Runnable* r0) { m.acquire(); r = r0; m.release(); // The Windows specific handle to a thread HANDLE w_h; w_h = CreateThread(NULL, 0, bootstrap, this, 0, NULL); if (w_h == NULL) throw OperatingSystemError("Thread::run[Windows::CreateThread]"); if (CloseHandle(w_h) == 0) throw OperatingSystemError("Thread::run[Windows::CloseHandle]"); }
Thread::Run::Run(Runnable* r0) { m.acquire(); r = r0; m.release(); // The Pthread specific thread datastructure pthread_t p_t; if (pthread_create(&p_t, NULL, bootstrap, this) != 0) throw OperatingSystemError("Thread::run[pthread_create]"); }
forceinline Event::~Event(void) { if (CloseHandle(w_h) == 0) throw OperatingSystemError("Event::~Event[Windows::CloseHandle]"); }
forceinline void Event::wait(void) { if (WaitForSingleObject(w_h,INFINITE) != 0) throw OperatingSystemError("Event::wait[Windows::WaitForSingleObject]"); }
forceinline void Event::signal(void) { if (SetEvent(w_h) == 0) throw OperatingSystemError("Event::signal[Windows::SetEvent]"); }
/* * Event */ forceinline Event::Event(void) : w_h(CreateEvent(NULL, FALSE, FALSE, NULL)) { if (w_h == NULL) throw OperatingSystemError("Event::Event[Windows::CreateEvent]"); }
/* * Thread */ inline Thread::Run::Run(Runnable*) { throw OperatingSystemError("Thread::run[Threads not supported]"); }