//----------------------------------------------- // mutex.h: too restrictive for readers //----------------------------------------------- #ifndef mutex_h #define mutex_h //----------------------------------------------- #include // std::size_t #include // std::mutex //----------------------------------------------- class mutex_lock { public: mutex_lock(std::size_t) {} void reader_lock() { mutex.lock(); } void reader_unlock() { mutex.unlock(); } void writer_lock() { mutex.lock(); } void writer_unlock() { mutex.unlock(); } private: std::mutex mutex; }; //----------------------------------------------- #endif // mutex_h