From 39cd2bf8feccf0a26a15d6428bb62cbf9a8eedb2 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 23 Nov 2017 08:05:48 +0100 Subject: [PATCH] ipcpipeline: Simplify usage of g_cond_wait_until() 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/ipcpipeline/gstipcpipelinecomm.c b/sys/ipcpipeline/gstipcpipelinecomm.c index c6400974f4..8cecfba508 100644 --- a/sys/ipcpipeline/gstipcpipelinecomm.c +++ b/sys/ipcpipeline/gstipcpipelinecomm.c @@ -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);