Added pthread cancelling when calling opticflow_module_stop()

Added pthread cancelling of opticflow thread and returns error on failure.

closes #1578
This commit is contained in:
Nikhil Potdar
2016-03-27 18:21:27 +02:00
committed by Felix Ruess
parent 1e35a83e43
commit 0b13661a13
@@ -213,7 +213,10 @@ void opticflow_module_stop(void)
// Stop the capturing // Stop the capturing
v4l2_stop_capture(opticflow_dev); v4l2_stop_capture(opticflow_dev);
// TODO: fix thread stop // Cancel the opticalflow calculation thread
if (pthread_cancel(opticflow_calc_thread) != 0) {
printf("Thread cancel did not work\n");
}
} }
/** /**