ocs_thread_terminate_requested
extern int32_t ocs_thread_terminate_requested(ocs_thread_t *thread);
while (!ocs_thread_terminate_requested(mythread)) {