From 081d002461b9a1087095c8322f8eaa2fc724663f Mon Sep 17 00:00:00 2001 From: Kristof Hannemann <50989282+hannemn@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:33:12 +0100 Subject: [PATCH] Passing relative time to pthread_cond_timedwait on macOS --- ecal/core/src/io/linux/ecal_named_mutex_impl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ecal/core/src/io/linux/ecal_named_mutex_impl.cpp b/ecal/core/src/io/linux/ecal_named_mutex_impl.cpp index 2ba6ee22f6..6979987ae0 100644 --- a/ecal/core/src/io/linux/ecal_named_mutex_impl.cpp +++ b/ecal/core/src/io/linux/ecal_named_mutex_impl.cpp @@ -291,9 +291,10 @@ namespace eCAL // timeout_ > 0 -> wait timeout_ ms else { - struct timespec abstime {}; + struct timespec abstime {}; +#ifndef ECAL_OS_MACOS clock_gettime(CLOCK_MONOTONIC, &abstime); - +#endif abstime.tv_sec = abstime.tv_sec + timeout_ / 1000; abstime.tv_nsec = abstime.tv_nsec + (timeout_ % 1000) * 1000000; while (abstime.tv_nsec >= 1000000000)