![](/img/trans.png)
[英]Why makecontext/swapcontext does not work with pthread_mutex_lock/pthread_mutex_unlock
[英]What is the behaviour of calling pthread_mutex_lock and pthread_mutex_unlock with NULL?
以 NULL 作為參數調用 pthread_mutex_lock 和 pthread_mutex_unlock 的行為是什么?
閱讀手冊。 它明確指出:
如果 mutex 不引用已初始化的 mutex object,則 pthread_mutex_lock()、pthread_mutex_trylock() 和 pthread_mutex_unlock() 的行為未定義。
如果您對 C 有經驗,您可能知道這意味着什么:不要這樣做!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.