5 extern void _PDCLIB_w32errno( void );
\r
6 int mtx_unlock(mtx_t *mtx)
\r
8 if(mtx->_NestCount) {
\r
10 return thrd_success;
\r
15 DWORD res = InterlockedDecrement(&mtx->_State);
\r
16 if(res == (DWORD) -1) {
\r
17 // We reset the state to -1; success!
\r
18 return thrd_success;
\r
21 DWORD rv = SetEvent(mtx->_WaitEvHandle);
\r
27 return thrd_success;
\r
32 #include <_PDCLIB_test.h>
\r
36 return TEST_RESULTS;
\r