Skip to content
Discussion options

You must be logged in to vote

You've found a bug, thanks! You're on linux, right?

deadline parameter of Semaphore::timed_wait is supposed to be absolute time in CLOCK_MONOTONIC domain. The code that uses it, as well as your example, pass monotonic timestamps to it.

However in roc_core/target_posix_ext/roc_core/semaphore.cpp we pass deadline to sem_timedwait, which expects time in CLOCK_REALTIME domain (i.e. since epoch).

Hence it returns immediately - monotonic timestamps are typically smaller than wallclock timestamps, and it thinks that deadline is already expired.

I've created an issue: #795

You can fix it by yourself (it should be straightforward I guess), otherwise you could wait until I take a look, I think I'll…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Flw5469
Comment options

@gavv
Comment options

gavv Jan 22, 2025
Maintainer

Answer selected by Flw5469
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants