diff options
Diffstat (limited to 'lib/libpthread/thread/thr_yield.c')
-rw-r--r-- | lib/libpthread/thread/thr_yield.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_yield.c b/lib/libpthread/thread/thr_yield.c index acaa3c5..dfe7278 100644 --- a/lib/libpthread/thread/thr_yield.c +++ b/lib/libpthread/thread/thr_yield.c @@ -46,8 +46,9 @@ _sched_yield(void) curthread->slice_usec = -1; /* Schedule the next thread: */ + THR_LOCK_SWITCH(curthread); _thr_sched_switch(curthread); - + THR_UNLOCK_SWITCH(curthread); /* Always return no error. */ return(0); } @@ -62,5 +63,7 @@ _pthread_yield(void) curthread->slice_usec = -1; /* Schedule the next thread: */ + THR_LOCK_SWITCH(curthread); _thr_sched_switch(curthread); + THR_UNLOCK_SWITCH(curthread); } |