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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_yield.c b/lib/libpthread/thread/thr_yield.c
index b41072f..5c24113 100644
--- a/lib/libpthread/thread/thr_yield.c
+++ b/lib/libpthread/thread/thr_yield.c
@@ -42,6 +42,9 @@ _sched_yield(void)
{
struct pthread *curthread = _get_curthread();
+ if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM)
+ return (__sys_sched_yield());
+
/* Reset the accumulated time slice value for the current thread: */
curthread->slice_usec = -1;
@@ -57,6 +60,11 @@ _pthread_yield(void)
{
struct pthread *curthread = _get_curthread();
+ if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) {
+ __sys_sched_yield();
+ return;
+ }
+
/* Reset the accumulated time slice value for the current thread: */
curthread->slice_usec = -1;
OpenPOWER on IntegriCloud