5 int mtx_trylock(mtx_t *mtx)
\r
7 DWORD myId = GetCurrentThreadId();
\r
9 if(mtx->_ThreadId == (long) myId) {
\r
11 return thrd_success;
\r
14 if(mtx->_ThreadId != 0)
\r
17 LONG prev = InterlockedCompareExchange(&mtx->_ThreadId, myId, 0);
\r
19 return thrd_success;
\r
26 #include "_PDCLIB_test.h"
\r
30 return TEST_RESULTS;
\r