| 101 | } |
| 102 | |
| 103 | int SemWait (SWelsDecSemphore* s, int32_t timeout) { |
| 104 | DWORD result; |
| 105 | if ((uint32_t)timeout == WELS_DEC_THREAD_WAIT_INFINITE || timeout < 0) |
| 106 | result = WaitForSingleObject (s->h, INFINITE); |
| 107 | else |
| 108 | result = WaitForSingleObject (s->h, timeout); |
| 109 | |
| 110 | if (result == WAIT_OBJECT_0) { |
| 111 | return WELS_DEC_THREAD_WAIT_SIGNALED; |
| 112 | } else { |
| 113 | return WELS_DEC_THREAD_WAIT_TIMEDOUT; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | void SemRelease (SWelsDecSemphore* s, long* prevcount) { |
| 118 | ReleaseSemaphore (s->h, 1, prevcount); |
nothing calls this directly
no test coverage detected