| 97 | } |
| 98 | |
| 99 | XN_C_API XnStatus xnOSWaitAndTerminateThread(XN_THREAD_HANDLE* pThreadHandle, XnUInt32 nMilliseconds) |
| 100 | { |
| 101 | XnStatus nRetVal = XN_STATUS_OK; |
| 102 | |
| 103 | XN_VALIDATE_INPUT_PTR(pThreadHandle); |
| 104 | |
| 105 | // first, wait for thread to exit on its own |
| 106 | nRetVal = xnOSWaitForThreadExit(*pThreadHandle, nMilliseconds); |
| 107 | if (nRetVal != XN_STATUS_OK) |
| 108 | { |
| 109 | // thread did not exit on its own. Kill it. |
| 110 | xnLogWarning(XN_MASK_OS, "Thread did not shutdown in %u ms. Thread will be killed...", nMilliseconds); |
| 111 | xnOSTerminateThread(pThreadHandle); |
| 112 | } |
| 113 | else |
| 114 | { |
| 115 | // thread exited. Just close the handle. |
| 116 | xnOSCloseThread(pThreadHandle); |
| 117 | } |
| 118 | |
| 119 | return (XN_STATUS_OK); |
| 120 | } |
| 121 | |
| 122 | XN_C_API XnStatus xnOSLoadFile(const XnChar* cpFileName, void* pBuffer, const XnUInt32 nBufferSize) |
| 123 | { |
no test coverage detected