If you unlock an already unlocked mutex, is the behavior undefined?

前端 未结 6 1627
半阙折子戏
半阙折子戏 2020-12-29 03:10

If you unlock an already unlocked mutex, is the behavior unsafe, safe, or undefined?

The purpose of the question is related to the following code, where I don\'t kno

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 03:59

    In general, for questions like this, the documentation is the best source of information. Different mutexes may behave differently, or there may be options on a single mutex which cause it to behave different (such as in the case of recursively acquiring a mutex on a single thread).

提交回复
热议问题