The thread suspend function now returns ETIMEDOUT, not EAGAIN.

This commit is contained in:
Mike Makonnen 2004-03-29 09:35:07 +00:00
parent ece20938e5
commit 0c3a942692
2 changed files with 2 additions and 3 deletions

View File

@ -308,10 +308,9 @@ cond_wait_common(pthread_cond_t * cond, pthread_mutex_t * mutex,
* before we got a chance to run again. We check for
* this by looking to see if our state is RUNNING.
*/
if (rval == EAGAIN) {
if (rval == ETIMEDOUT) {
if (curthread->state != PS_RUNNING) {
PTHREAD_SET_STATE(curthread, PS_RUNNING);
rval = ETIMEDOUT;
} else
rval = 0;
}

View File

@ -905,7 +905,7 @@ get_mcontested(pthread_mutex_t mutexp, const struct timespec *abstime)
PANIC("Cannot suspend on mutex.");
_SPINLOCK(&mutexp->lock);
_thread_critical_enter(curthread);
if (error == EAGAIN) {
if (error == ETIMEDOUT) {
/*
* Between the timeout and when the mutex was
* locked the previous owner may have released