diff options
author | 2004-09-18 19:57:35 +0000 | |
---|---|---|
committer | 2004-09-18 19:57:35 +0000 | |
commit | a170dc949eab83159ced4f586bfdde963c56db4f (patch) | |
tree | abbc4a98a72fd108555dcf0ab28e44e045b86859 /lib/libpthread | |
parent | regen w/ proper rcsids and const (diff) | |
download | wireguard-openbsd-a170dc949eab83159ced4f586bfdde963c56db4f.tar.xz wireguard-openbsd-a170dc949eab83159ced4f586bfdde963c56db4f.zip |
Allow thread in FD{R,W}_WAIT states to be suspended.
Patch from Kurt Miller <truk at optonline.net>
Commit reminder from millert@. OK brad@
Diffstat (limited to 'lib/libpthread')
-rw-r--r-- | lib/libpthread/uthread/uthread_suspend_np.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_suspend_np.c b/lib/libpthread/uthread/uthread_suspend_np.c index 6d75bb0198b..2caca0030df 100644 --- a/lib/libpthread/uthread/uthread_suspend_np.c +++ b/lib/libpthread/uthread/uthread_suspend_np.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_suspend_np.c,v 1.8 2004/05/01 22:15:10 marc Exp $ */ +/* $OpenBSD: uthread_suspend_np.c,v 1.9 2004/09/18 19:57:35 marc Exp $ */ /* * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>. * All rights reserved. @@ -106,9 +106,19 @@ suspend_common(struct pthread *thread) PTHREAD_SET_STATE(thread, PS_SUSPENDED); break; - case PS_SPINBLOCK: case PS_FDR_WAIT: case PS_FDW_WAIT: + /* + * Remove these threads from the work queue + * and set the state to suspended: + */ + if ((thread->flags & PTHREAD_FLAGS_IN_WORKQ) != 0) + PTHREAD_WORKQ_REMOVE(thread); + PTHREAD_WAITQ_REMOVE(thread); + PTHREAD_SET_STATE(thread, PS_SUSPENDED); + break; + + case PS_SPINBLOCK: case PS_POLL_WAIT: case PS_SELECT_WAIT: /* |