diff options
Diffstat (limited to 'lib/libpthread/thread/thr_nanosleep.c')
-rw-r--r-- | lib/libpthread/thread/thr_nanosleep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_nanosleep.c b/lib/libpthread/thread/thr_nanosleep.c index bec3b66..e83f4f4 100644 --- a/lib/libpthread/thread/thr_nanosleep.c +++ b/lib/libpthread/thread/thr_nanosleep.c @@ -60,14 +60,14 @@ _nanosleep(const struct timespec *time_to_sleep, /* Calculate the time for the current thread to wake up: */ TIMESPEC_ADD(&curthread->wakeup_time, &ts, time_to_sleep); - THR_SCHED_LOCK(curthread, curthread); + THR_LOCK_SWITCH(curthread); curthread->interrupted = 0; THR_SET_STATE(curthread, PS_SLEEP_WAIT); - THR_SCHED_UNLOCK(curthread, curthread); /* Reschedule the current thread to sleep: */ _thr_sched_switch(curthread); + THR_UNLOCK_SWITCH(curthread); /* Calculate the remaining time to sleep: */ KSE_GET_TOD(curthread->kse, &ts1); |