mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-04 12:52:15 +00:00
Check invalid mutex in _mutex_cv_unlock.
This commit is contained in:
parent
8d2a935e45
commit
ec92603cf9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213257
@ -636,6 +636,12 @@ _mutex_cv_unlock(pthread_mutex_t *mutex, int *count)
|
|||||||
struct pthread_mutex *m;
|
struct pthread_mutex *m;
|
||||||
|
|
||||||
m = *mutex;
|
m = *mutex;
|
||||||
|
if (__predict_false(m <= THR_MUTEX_DESTROYED)) {
|
||||||
|
if (m == THR_MUTEX_DESTROYED)
|
||||||
|
return (EINVAL);
|
||||||
|
return (EPERM);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if the running thread is not the owner of the mutex.
|
* Check if the running thread is not the owner of the mutex.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user