-\r
- // If that increment didn't leave the state == 0, then we have contention\r
- // -> block on the wait event handle\r
- DWORD rv = WaitForSingleObject(mtx->_WaitEvHandle, INFINITE);\r
- if(rv != WAIT_OBJECT_0) \r
- return thrd_error;\r
-\r
- // We now own the mutex - so set it up for our use\r
- mtx->_ThreadId = myId;\r
- return thrd_success;\r