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

Function xnSchedulerRemoveTask

Source/OpenNI/XnScheduler.cpp:314–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314XN_C_API XnStatus xnSchedulerRemoveTask(XnScheduler* pScheduler, XnScheduledTask** ppTask)
315{
316 XnStatus nRetVal = XN_STATUS_OK;
317
318 XN_VALIDATE_INPUT_PTR(pScheduler);
319 XN_VALIDATE_INPUT_PTR(ppTask);
320 XN_VALIDATE_INPUT_PTR(*ppTask);
321
322 XnScheduledTask* pTask = *ppTask;
323
324 // enter critical section
325 nRetVal = xnOSEnterCriticalSection(&pScheduler->hCriticalSection);
326 XN_IS_STATUS_OK(nRetVal);
327
328 XnSchedulerRemoveTaskInternal(pScheduler, pTask);
329
330 // leave critical section
331 nRetVal = xnOSLeaveCriticalSection(&pScheduler->hCriticalSection);
332 XN_IS_STATUS_OK(nRetVal);
333
334 // notify that the list has changed
335 nRetVal = xnOSSetEvent(pScheduler->hWakeThreadEvent);
336 if (nRetVal != XN_STATUS_OK)
337 {
338 xnLogWarning(XN_MASK_SCHEDULER, "Failed setting event when removing task: %s", xnGetStatusString(nRetVal));
339 }
340
341 xnOSFree(pTask);
342
343 *ppTask = NULL;
344
345 return (XN_STATUS_OK);
346}
347
348XN_C_API XnStatus xnSchedulerRescheduleTask(XnScheduler* pScheduler, XnScheduledTask* pTask, XnUInt64 nInterval)
349{

Callers

nothing calls this directly

Calls 6

xnGetStatusStringFunction · 0.85
xnOSEnterCriticalSectionFunction · 0.50
xnOSLeaveCriticalSectionFunction · 0.50
xnOSSetEventFunction · 0.50
xnOSFreeFunction · 0.50

Tested by

no test coverage detected