Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
fixup! Properly handle timeout in semaphores
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Dec 11, 2017
1 parent 9c8cde3 commit 9328eeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pthread/phal.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ int phal_mutex_lock(phal_mutex *mutex);
int phal_mutex_unlock(phal_mutex *mutex);

// TODO: pass timespec instead
int phal_thread_sleep(int msec);
int phal_thread_sleep(uint64_t msec);
5 changes: 3 additions & 2 deletions pthread/sys/switch/phal.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ void phal_thread_exit(phal_tid *tid) {
svcExitThread();
}

int phal_thread_sleep(int msec) {
return svcSleepThread(msec * 1000000);
int phal_thread_sleep(uint64_t msec) {
u64 nanos = msec * 1000 * 1000;
return svcSleepThread(nanos);
}

int phal_semaphore_create(phal_semaphore *sem) {
Expand Down

0 comments on commit 9328eeb

Please sign in to comment.