done reverse unlock in multimutex

This commit is contained in:
joaquintides
2023-03-15 09:09:09 +01:00
committed by Christian Mazakas
parent 2070cbe2cc
commit 5881dcc2b2

View File

@ -51,8 +51,8 @@ public:
return mutexes[pos];
}
void lock()noexcept{for(auto&m:mutexes)m.lock();}
void unlock()noexcept{for(auto&m:mutexes)m.unlock();}
void lock()noexcept{for(auto& m:mutexes)m.lock();}
void unlock()noexcept{for(auto n=N;n--;)mutexes[n].unlock();}
private:
mutable std::array<Mutex,N> mutexes;