Skip to content

Commit

Permalink
Passing relative time to pthread_cond_timedwait on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
hannemn authored Mar 27, 2024
1 parent 1ac0d3b commit 081d002
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ecal/core/src/io/linux/ecal_named_mutex_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 081d002

Please sign in to comment.