Skip to content

Use CLOCK_MONOTONIC for mutex waiting on iOS/macOS #73650

Open
@akoeplinger

Description

@akoeplinger

See #58737 and related PRs.

CLOCK_MONOTONIC is available on ios 10+, but not pthread_condattr_setclock. We disable the code on Apple platforms using BROKEN_CLOCK_SOURCE in

#if !defined(CLOCK_MONOTONIC) || defined(HOST_DARWIN) || defined(HOST_WASM)
#define BROKEN_CLOCK_SOURCE
#endif

We should look into using pthread_cond_timedwait with a CLOCK_MONOTONIC argument or alternatively enable clock_gettime (supported by newer macOS/iOS releases) on Apple platforms.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions