X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=platform%2Fwin32%2Ffunctions%2Fthreads%2Fmtx_unlock.c;h=1222c292ea42ffa47b934fb154ad3df68ef58a69;hp=27b7aefadb7d6ff4a277c1e6fedadb27bca74e9d;hb=3b357986c8ac26f3aee1033c49c28f58c3cd2fb4;hpb=3979dd45fb1088cc27bcde72f0d4a51c80035e4f diff --git a/platform/win32/functions/threads/mtx_unlock.c b/platform/win32/functions/threads/mtx_unlock.c index 27b7aef..1222c29 100644 --- a/platform/win32/functions/threads/mtx_unlock.c +++ b/platform/win32/functions/threads/mtx_unlock.c @@ -11,19 +11,11 @@ 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