]> pd.if.org Git - pdclib/blob - platform/win32/functions/threads/mtx_init.c
win32: initial pass at thread support
[pdclib] / platform / win32 / functions / threads / mtx_init.c
1 #ifndef REGTEST\r
2 #include <threads.h>\r
3 #include <windows.h>\r
4 \r
5 int mtx_init(mtx_t *mtx, int type)\r
6 {\r
7     mtx->_WaitEvHandle = CreateEvent(NULL, \r
8         /* bManualReset*/   FALSE, \r
9         /* bInitialState*/  FALSE, \r
10         /* name*/           NULL);\r
11     if(mtx->_WaitEvHandle == NULL)\r
12         return thrd_error;\r
13     \r
14     mtx->_State        = -1;\r
15     mtx->_ThreadId     = 0;\r
16     mtx->_NestCount    = 0;;\r
17 \r
18     return thrd_success;\r
19 }\r
20 #endif\r
21 \r
22 #ifdef TEST\r
23 #include <_PDCLIB_test.h>\r
24 \r
25 int main( void )\r
26 {\r
27     return TEST_RESULTS;\r
28 }\r
29 \r
30 #endif