[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: is there a chance for a race condition in pthread_mutex_[un]lock.c?



Perez-Gonzalez, Inaky wrote on 12/17/2003, 7:51 AM:
>> Still makes me nervous that this situation can go undetected. 
> Would it be worth to assert that __owner != 0 on unlock() to 
> catch this case?

I do not think an implementation is required to
detect this programming error unless the mutex
type is PTHREAD_MUTEX_ERRORCHECK.  If it detects
this programming error, pthread_mutex_unlock
should fail with the EPERM error code.

http://www.opengroup.org/onlinepubs/007904975/functions/pthread_mutex_lock.html

Wan-Teh




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]