C ++ Standard, [thread.mutex.requirements.mutex] / 21 and 22:
The expression m.unlock()
must be well formed and have the following semantics:
Required: The calling thread must have a mutex.
Violation of requirements in the Requires clause causes undefined behavior.
source
to share