- ~Semaphore() { pthread_cond_destroy(&sem); }
-#else
- Semaphore() { sem=CreateSemaphore(0, 0, 32, 0); }
- int signal() { return !ReleaseSemaphore(sem, 1, 0); }
- int broadcast() { return !ReleaseSemaphore(sem, 32, 0); }
- int wait() { return WaitForSingleObject(sem, INFINITE)==WAIT_OBJECT_0; }
- int wait(const Time::TimeDelta &);
- ~Semaphore() { CloseHandle(sem); }
-#endif