MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / xnOSWaitAndTerminateThread

Function xnOSWaitAndTerminateThread

Source/OpenNI/XnOS.cpp:99–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99XN_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
122XN_C_API XnStatus xnOSLoadFile(const XnChar* cpFileName, void* pBuffer, const XnUInt32 nBufferSize)
123{

Callers 5

BeforeNodeDestroyMethod · 0.85
xnProfilingShutdownFunction · 0.85
FreeSchedulerFunction · 0.85
xnUSBDeviceShutdownFunction · 0.85
xnUSBShutdownReadThreadFunction · 0.85

Calls 3

xnOSWaitForThreadExitFunction · 0.50
xnOSTerminateThreadFunction · 0.50
xnOSCloseThreadFunction · 0.50

Tested by

no test coverage detected