Skip to content

Why don't timed_mutex, recursive_timed_mutex, and shared_timed_mutex have native_handle? #3387

Discussion options

You must be logged in to vote

Yes, I believe this is intentional. The three subject types are all implemented with a mutex, a condition_variable, and some other small bits of state; there's nothing that native_handle could usefully return. It's arguably bogus that mutex, recursive_mutex, and condition_variable return a native_handle that's only usable by going out of contract and calling library internals, I think anything we could do for the meow_timed_mutexes would be even worse.

To my knowledge, the intent of having native_handle for the types in the threading library is that one can get at the underlying POSIX thread library objects (hopefully) used to implement the C++ types so C code can interact with the same s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by frederick-vs-ja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants