The pthread_mutex_lock Open Group Base Specification says so: 如果互斥锁类型为PTHREAD_MUTEX_NORMAL [...]如果线程尝试解锁尚未锁定的互斥锁或已解锁的互斥锁,则会导致未定义的行为. If the mutex type is PTHREAD_MUTEX_NORMAL [...] If a thread attempts to unlock a mutex that it has not locked or a mutex which is unlocked, undefined behavior results. 这篇关于在一个线程中锁定互斥锁,在另一个线程中解锁互斥锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-16 02:03