| 191 | |
| 192 | |
| 193 | void CriticalSection::unlock(bool errorCheck) |
| 194 | { |
| 195 | #ifdef _WIN32 |
| 196 | |
| 197 | if(!ReleaseMutex(mutex) && errorCheck) |
| 198 | throw(W32Error("CriticalSection::unlock()")); |
| 199 | |
| 200 | #else |
| 201 | |
| 202 | int ret; |
| 203 | if((ret = pthread_mutex_unlock(&mutex)) != 0 && errorCheck) |
| 204 | throw(Error("CriticalSection::unlock()", strerror(ret))); |
| 205 | |
| 206 | #endif |
| 207 | } |
| 208 | |
| 209 | |
| 210 | Semaphore::Semaphore(long initialCount) |