| 324 | |
| 325 | |
| 326 | void Semaphore::post(void) |
| 327 | { |
| 328 | #ifdef _WIN32 |
| 329 | |
| 330 | if(!ReleaseSemaphore(sem, 1, NULL)) throw(W32Error("Semaphore::post()")); |
| 331 | |
| 332 | #elif defined(__APPLE__) |
| 333 | |
| 334 | if(sem_post(sem) == -1) throw(UnixError("Semaphore::post()")); |
| 335 | |
| 336 | #else |
| 337 | |
| 338 | if(sem_post(&sem) == -1) throw(UnixError("Semaphore::post()")); |
| 339 | |
| 340 | #endif |
| 341 | } |
| 342 | |
| 343 | |
| 344 | long Semaphore::getValue(void) |