Closed
Description
This should be a pair of types built directly on the platform primitives. On Windows, it should directly wrap CRITICAL_SECTION
and CONDITION_VARIABLE
while on *nix it would wrap pthread_mutex_t
and pthread_cond_t
. It can then be wrapped into a new high-level safe API.
C++11 also exposes a portable recursive mutex, which would be an easy addition. It could allow expose adaptive mutexes (faster, at the expense of fairness) when available since falling back to normal mutexes is a portable implementation.