I wanted to use a std::mutex
in my class, and noticed that it isn't copyable. I'm at the bottom level of my library here, so it seems like a terrible idea to have this behaviour.
I used std::lock_guard
on the std::mutex
, but there doesn't seem to be a shared_lock_guard
, which would be preferable to provide write-locks-exclusively behaviour. Is this an oversight or trivial to implement myself?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…