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=639bad513ab9399ed9a8c588a476a10dbe6c9478;hp=0000000000000000000000000000000000000000;hpb=008908f7a61acf9df1248c005378a3c4b4393547;p=pdclib 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