summaryrefslogtreecommitdiff
path: root/lib/libpthread/uthread/uthread_yield.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/uthread/uthread_yield.c')
-rw-r--r--lib/libpthread/uthread/uthread_yield.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libpthread/uthread/uthread_yield.c b/lib/libpthread/uthread/uthread_yield.c
index 055555dec6d..32852ee847a 100644
--- a/lib/libpthread/uthread/uthread_yield.c
+++ b/lib/libpthread/uthread/uthread_yield.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_yield.c,v 1.4 2001/08/04 14:43:53 fgsch Exp $ */
+/* $OpenBSD: uthread_yield.c,v 1.5 2001/08/21 19:24:53 fgsch Exp $ */
/*
* Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -39,8 +39,10 @@
int
sched_yield(void)
{
+ struct pthread *curthread = _get_curthread();
+
/* Reset the accumulated time slice value for the current thread: */
- _thread_run->slice_usec = -1;
+ curthread->slice_usec = -1;
/* Schedule the next thread: */
_thread_kern_sched(NULL);
@@ -53,8 +55,10 @@ sched_yield(void)
void
pthread_yield(void)
{
+ struct pthread *curthread = _get_curthread();
+
/* Reset the accumulated time slice value for the current thread: */
- _thread_run->slice_usec = -1;
+ curthread->slice_usec = -1;
/* Schedule the next thread: */
_thread_kern_sched(NULL);