ipcpipeline: Simplify usage of g_cond_wait_until()
authorEdward Hervey <edward@centricular.com>
Thu, 23 Nov 2017 07:05:48 +0000 (08:05 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 23 Nov 2017 07:05:48 +0000 (08:05 +0100)
It will return FALSE if a timeout happened. So don't check if we
timed out afterwards, just use the return value.

CID #1416347

sys/ipcpipeline/gstipcpipelinecomm.c

index c640097..8cecfba 100644 (file)
@@ -102,8 +102,7 @@ comm_request_wait (GstIpcPipelineComm * comm, CommRequest * req,
       req->id);
   while (!req->replied) {
     if (ack_type == ACK_TYPE_TIMED) {
-      g_cond_wait_until (&req->cond, &comm->mutex, end_time);
-      if (g_get_monotonic_time () >= end_time)
+      if (!g_cond_wait_until (&req->cond, &comm->mutex, end_time))
         break;
     } else
       g_cond_wait (&req->cond, &comm->mutex);