meganz / mingw-std-threads

Standard threads implementation currently still missing on MinGW GCC on Windows
BSD 2-Clause "Simplified" License
439 stars 137 forks source link

Fix timed mutex, tweak call_once #85

Closed nmcclatchey closed 2 years ago

nmcclatchey commented 2 years ago

Fixes the timed_mutex class to have a constructor (was failing due to the base class being inherited privately). This fixes #84 .

Adjusts the second read in call_once to use relaxed semantics, rather than acquire semantics. This should slightly improve performance, and is correct because this second load occurs after acquiring the mutex, which in itself acquires the result of the called function.

alxvasilev commented 2 years ago

Thanks!