Skip to content

Conversation

@Flw5469
Copy link

@Flw5469 Flw5469 commented Jan 26, 2025

Fix according to #795

  1. Use sem_clockwait if available
  2. Else use sem_timedwait and convert time parameter's domain from ClockMonotonic into ClockUnix

@github-actions
Copy link

🤖 Upon creation, pull request description does not have a link to an issue. If there is a related issue, please add it to the description using any of the supported formats.

@Flw5469 Flw5469 marked this pull request as draft January 26, 2025 13:51
@github-actions github-actions bot added the S-work-in-progress status: PR is still in progress and changing label Jan 26, 2025
@gavv
Copy link
Member

gavv commented Jan 27, 2025

I haven't looked at the PR yet (let me know when it's ready), but I've checked how we could detect if sem_clockwait is available.

Seems that POSIX doesn't define any useful macro. The function was introduced in POSIX-2017, but they didn't bump _POSIX_VERSION and it's the same for POSIX-2008 and POSIX-2017.

So seems we should check it in the build system. You can add this to SConstruct before conf.Finish() call:

# feature availability
if conf.CheckFunc('sem_clockwait', header='#include <unistd.h>'):
    conf.env.Append(CPPDEFINES=['ROC_HAVE_SEM_CLOCKWAIT'])

env = conf.Finish()

..and then you can use #ifdef ROC_HAVE_SEM_CLOCKWAIT

@gavv gavv added the contrib PR not by a maintainer label Jan 27, 2025
@Flw5469 Flw5469 closed this May 30, 2025
@rocstreaming-bot rocstreaming-bot removed the S-work-in-progress status: PR is still in progress and changing label May 30, 2025
@gavv
Copy link
Member

gavv commented Jun 8, 2025

Moved to #814

@gavv gavv added the S-moved status: Transitioned to another issue or PR label Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contrib PR not by a maintainer S-moved status: Transitioned to another issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants