wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
shared_mutex.hpp File Reference

Reader/writer mutex used across the library. More...

#include <shared_mutex>
Include dependency graph for shared_mutex.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  wowlib

Typedefs

using wowlib::SharedMutex = std::shared_mutex

Detailed Description

Reader/writer mutex used across the library.

On MinGW-built Windows binaries libstdc++'s std::shared_mutex delegates to winpthreads' pthread_rwlock, whose writer exclusion is unreliable under reader contention — CI observed two writers inside an "exclusive" section losing serialized listfile appends. There the OS-native slim reader/writer lock (SRWLOCK, what MSVC's std::shared_mutex wraps) is used instead; everywhere else SharedMutex is std::shared_mutex.

Definition in file shared_mutex.hpp.