X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fwin32%2Ffunctions%2Fthreads%2Fmtx_init.c;fp=platform%2Fwin32%2Ffunctions%2Fthreads%2Fmtx_init.c;h=19db3908dc0430cfa6b08be47877014999782565;hb=21c5050f9d173dc1ea751cb8d32549d22d01aba8;hp=0000000000000000000000000000000000000000;hpb=63253d8feb501c19ef09194a6da407a8c331cfad;p=pdclib.old diff --git a/platform/win32/functions/threads/mtx_init.c b/platform/win32/functions/threads/mtx_init.c new file mode 100644 index 0000000..19db390 --- /dev/null +++ b/platform/win32/functions/threads/mtx_init.c @@ -0,0 +1,30 @@ +#ifndef REGTEST +#include +#include + +int mtx_init(mtx_t *mtx, int type) +{ + mtx->_WaitEvHandle = CreateEvent(NULL, + /* bManualReset*/ FALSE, + /* bInitialState*/ FALSE, + /* name*/ NULL); + if(mtx->_WaitEvHandle == NULL) + return thrd_error; + + mtx->_State = -1; + mtx->_ThreadId = 0; + mtx->_NestCount = 0;; + + return thrd_success; +} +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main( void ) +{ + return TEST_RESULTS; +} + +#endif \ No newline at end of file