+ /*
+ * When termination of wait() and decode() was requested,
+ * then exit the loop after releasing the mutex.
+ */
+ if (di->want_wait_terminate) {
+ srd_dbg("%s: %s: Will return from wait().",
+ di->inst_id, __func__);
+ g_mutex_unlock(&di->data_mutex);
+ return NULL;
+ }
+