void simplethread_stop(t_simplethread *x) { unsigned int ret; if (x->x_systhread) { post("stopping our thread"); x->x_systhread_cancel = true; // tell the thread to stop systhread_join(x->x_systhread, &ret); // wait for the thread to stop x->x_systhread = NULL; } }
void jit_freenect_thread_stop(t_jit_freenect_grab *x) { unsigned int ret; if (x_systhread) { postNesa("jit_freenect_thread_stop:stopping our thread"); x_systhread_cancel = TRUE; // tell the thread to stop postNesa("jit_freenect_thread_stop:wait for the thread to stop"); systhread_join(x_systhread, &ret); // wait for the thread to stop x_systhread = NULL; } postNesa("jit_freenect_thread_stop:done"); }