summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_yield.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_yield.c')
-rw-r--r--lib/libpthread/thread/thr_yield.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_yield.c b/lib/libpthread/thread/thr_yield.c
index a88a948..877f5e6 100644
--- a/lib/libpthread/thread/thr_yield.c
+++ b/lib/libpthread/thread/thr_yield.c
@@ -34,6 +34,20 @@
#include <pthread.h>
#include "pthread_private.h"
+int
+sched_yield(void)
+{
+ /* Reset the accumulated time slice value for the current thread: */
+ _thread_run->slice_usec = -1;
+
+ /* Schedule the next thread: */
+ _thread_kern_sched(NULL);
+
+ /* Always return no error. */
+ return(0);
+}
+
+/* Draft 4 yield */
void
pthread_yield(void)
{
OpenPOWER on IntegriCloud