X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fwin32%2Ffunctions%2Fthreads%2Fmtx_unlock.c;h=bd1e6038d3ad27c4a969468236ea7c2ecf40bbca;hb=ed26bf80a4713c6b1f158571f3090f4cbb2d64f7;hp=27b7aefadb7d6ff4a277c1e6fedadb27bca74e9d;hpb=639bad513ab9399ed9a8c588a476a10dbe6c9478;p=pdclib diff --git a/platform/win32/functions/threads/mtx_unlock.c b/platform/win32/functions/threads/mtx_unlock.c index 27b7aef..bd1e603 100644 --- a/platform/win32/functions/threads/mtx_unlock.c +++ b/platform/win32/functions/threads/mtx_unlock.c @@ -11,25 +11,17 @@ int mtx_unlock(mtx_t *mtx) } mtx->_ThreadId = 0; - - DWORD res = InterlockedDecrement(&mtx->_State); - if(res == (DWORD) -1) { - // We reset the state to -1; success! - return thrd_success; - } - DWORD rv = SetEvent(mtx->_WaitEvHandle); if(rv == 0) { _PDCLIB_w32errno(); return thrd_error; } - return thrd_success; } #endif #ifdef TEST -#include <_PDCLIB_test.h> +#include "_PDCLIB_test.h" int main( void ) {