diff options
| author | Mike Makonnen <mtm@FreeBSD.org> | 2003-06-30 12:35:31 +0000 |
|---|---|---|
| committer | Mike Makonnen <mtm@FreeBSD.org> | 2003-06-30 12:35:31 +0000 |
| commit | fadd82e36791b989a9636e15c2c81c716277183a (patch) | |
| tree | d6ff4b956445f60211778e73d0c4ef152464b4bd | |
| parent | fe9f481f9d03db0d54398e3782f172d0f7becb6f (diff) | |
Notes
| -rw-r--r-- | lib/libthr/thread/thr_cond.c | 2 | ||||
| -rw-r--r-- | lib/libthr/thread/thr_join.c | 4 | ||||
| -rw-r--r-- | lib/libthr/thread/thr_mutex.c | 6 |
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/libthr/thread/thr_cond.c b/lib/libthr/thread/thr_cond.c index 6a86b390df52..00dbb250320b 100644 --- a/lib/libthr/thread/thr_cond.c +++ b/lib/libthr/thread/thr_cond.c @@ -285,7 +285,7 @@ cond_wait_common(pthread_cond_t * cond, pthread_mutex_t * mutex, _thread_critical_exit(curthread); COND_UNLOCK(*cond); rval = _thread_suspend(curthread, (struct timespec *)abstime); - if (rval == -1) { + if (rval != 0 && rval != EAGAIN && rval != EINTR) { printf("foo"); fflush(stdout); abort(); diff --git a/lib/libthr/thread/thr_join.c b/lib/libthr/thread/thr_join.c index 8b579781ef1b..ed0336796af9 100644 --- a/lib/libthr/thread/thr_join.c +++ b/lib/libthr/thread/thr_join.c @@ -122,7 +122,9 @@ _pthread_join(pthread_t pthread, void **thread_return) _thread_critical_exit(curthread); THREAD_LIST_UNLOCK; DEAD_LIST_UNLOCK; - _thread_suspend(curthread, NULL); + ret = _thread_suspend(curthread, NULL); + if (ret != 0 && ret != EAGAIN && ret != EINTR) + PANIC("Unable to suspend in join."); /* * XXX - For correctness reasons. diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index 067f0f0288c8..7d7c4550b040 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -1396,6 +1396,8 @@ get_muncontested(pthread_mutex_t mutexp, int nonblock) static void get_mcontested(pthread_mutex_t mutexp) { + int error; + _thread_critical_enter(curthread); /* @@ -1410,7 +1412,9 @@ get_mcontested(pthread_mutex_t mutexp) curthread->data.mutex = mutexp; _thread_critical_exit(curthread); _SPINUNLOCK(&mutexp->lock); - _thread_suspend(curthread, NULL); + error = _thread_suspend(curthread, NULL); + if (error != 0 && error != EAGAIN && error != EINTR) + PANIC("Cannot suspend on mutex."); _SPINLOCK(&mutexp->lock); _thread_critical_enter(curthread); |
