Check invalid mutex in _mutex_cv_unlock.

This commit is contained in:
davidxu 2010-09-29 06:06:58 +00:00
parent 1ffab4f669
commit df6acfd7c4

View File

@ -636,6 +636,12 @@ _mutex_cv_unlock(pthread_mutex_t *mutex, int *count)
struct pthread_mutex *m;
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.
*/