簡體   English   中英

用 NULL 調用 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM