On Jun 15, 7:15 am, " XXXX@XXXXX.COM " < XXXX@XXXXX.COM >
So long as their is no corruption and error codes are sanely detected,
any other error code would indicate that the 'pthread_cond_timedwait'
function had done nothing at all. That is, any sanity checks the
implementation is capable of doing, it will do before it acquires or
For example, if you call 'pthread_cond_timedwait' without holding the
mutex, and the implementation is smart enough to detect this and
return 'EPERM', you still don't hold the mutex. If you call
'pthread_cond_timedwait' holding the wrong mutex, and the
implementation is smart enough to detect this and return 'EINVAL', you
still hold the wrong mutex.
Note that if your program violates the POSIX interface contract, you
should not rely on the implementation to sanely detect this. You
should not violate the interface contract at all. Just because you
will get sane behavior *IF* the implementation detects the problem
doesn't mean the implementation *WILL* detect the problem.