| 40 | |
| 41 | |
| 42 | static THREAD_HANDLE ThreadCreate(NATIVE_THREAD_PTR Proc,void *Data) |
| 43 | { |
| 44 | #ifdef _UNIX |
| 45 | /* |
| 46 | pthread_attr_t attr; |
| 47 | pthread_attr_init(&attr); |
| 48 | pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); |
| 49 | */ |
| 50 | pthread_t pt; |
| 51 | int Code=pthread_create(&pt,NULL/*&attr*/,Proc,Data); |
| 52 | if (Code!=0) |
| 53 | { |
| 54 | wchar Msg[100]; |
| 55 | swprintf(Msg,ASIZE(Msg),L"\npthread_create failed, code %d\n",Code); |
| 56 | ErrHandler.GeneralErrMsg(Msg); |
| 57 | ErrHandler.SysErrMsg(); |
| 58 | ErrHandler.Exit(RARX_FATAL); |
| 59 | } |
| 60 | return pt; |
| 61 | #else |
| 62 | DWORD ThreadId; |
| 63 | HANDLE hThread=CreateThread(NULL,0x10000,Proc,Data,0,&ThreadId); |
| 64 | if (hThread==NULL) |
| 65 | { |
| 66 | ErrHandler.GeneralErrMsg(L"CreateThread failed"); |
| 67 | ErrHandler.SysErrMsg(); |
| 68 | ErrHandler.Exit(RARX_FATAL); |
| 69 | } |
| 70 | return hThread; |
| 71 | #endif |
| 72 | } |
| 73 | |
| 74 | |
| 75 | static void ThreadClose(THREAD_HANDLE hThread) |
no test coverage detected