diff options
author | Jason Evans <jasone@FreeBSD.org> | 2000-06-14 17:17:41 +0000 |
---|---|---|
committer | Jason Evans <jasone@FreeBSD.org> | 2000-06-14 17:17:41 +0000 |
commit | 314be1347ba3b74b5e67aad5053dba8919768624 (patch) | |
tree | 5b1354c7e5ebafa899c00de702a53fbc1481f1fc /lib/libc_r/uthread/uthread_suspend_np.c | |
parent | 979ab7516260eb8e17b93759826df578635fdbe9 (diff) |
Notes
Diffstat (limited to 'lib/libc_r/uthread/uthread_suspend_np.c')
-rw-r--r-- | lib/libc_r/uthread/uthread_suspend_np.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/libc_r/uthread/uthread_suspend_np.c b/lib/libc_r/uthread/uthread_suspend_np.c index 9b081153cacd9..083f5526b7394 100644 --- a/lib/libc_r/uthread/uthread_suspend_np.c +++ b/lib/libc_r/uthread/uthread_suspend_np.c @@ -91,13 +91,23 @@ pthread_suspend_np(pthread_t thread) break; case PS_MUTEX_WAIT: + /* Mark the thread as suspended and still in a queue. */ + thread->suspended = SUSP_MUTEX_WAIT; + + PTHREAD_SET_STATE(thread, PS_SUSPENDED); + break; case PS_COND_WAIT: + /* Mark the thread as suspended and still in a queue. */ + thread->suspended = SUSP_COND_WAIT; + + PTHREAD_SET_STATE(thread, PS_SUSPENDED); + break; case PS_FDLR_WAIT: case PS_FDLW_WAIT: case PS_FILE_WAIT: case PS_JOIN: /* Mark the thread as suspended: */ - thread->suspended = 1; + thread->suspended = SUSP_YES; /* * Threads in these states may be in queues. @@ -134,7 +144,7 @@ pthread_suspend_np(pthread_t thread) static void finish_suspension(void *arg) { - if (_thread_run->suspended != 0) + if (_thread_run->suspended != SUSP_NO) _thread_kern_sched_state(PS_SUSPENDED, __FILE__, __LINE__); } |