diff options
author | jb <jb@FreeBSD.org> | 1998-11-15 09:58:26 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 1998-11-15 09:58:26 +0000 |
commit | 3715314d366a89dbd7df6124d745c95e1bdde448 (patch) | |
tree | 9a0fe180209378fbce78fde57445392dcdc88fc5 /lib/libpthread/thread/thr_kern.c | |
parent | ffd97e5342d926be2f35b764575b61c28801658c (diff) | |
download | FreeBSD-src-3715314d366a89dbd7df6124d745c95e1bdde448.zip FreeBSD-src-3715314d366a89dbd7df6124d745c95e1bdde448.tar.gz |
Close a window between unlocking a spinlock and changing the thread state.
Diffstat (limited to 'lib/libpthread/thread/thr_kern.c')
-rw-r--r-- | lib/libpthread/thread/thr_kern.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index 22746c7..3a6966b 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: uthread_kern.c,v 1.13 1998/09/30 06:36:56 jb Exp $ + * $Id: uthread_kern.c,v 1.14 1998/10/09 19:01:30 dt Exp $ * */ #include <errno.h> @@ -616,6 +616,22 @@ _thread_kern_sched_state(enum pthread_state state, char *fname, int lineno) return; } +void +_thread_kern_sched_state_unlock(enum pthread_state state, + spinlock_t *lock, char *fname, int lineno) +{ + /* Change the state of the current thread: */ + _thread_run->state = state; + _thread_run->fname = fname; + _thread_run->lineno = lineno; + + _SPINUNLOCK(lock); + + /* Schedule the next thread that is ready: */ + _thread_kern_sched(NULL); + return; +} + static void _thread_kern_select(int wait_reqd) { |