diff options
author | Agustina Arzille <avarzille@riseup.net> | 2017-02-01 12:32:52 -0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-03-04 23:11:20 +0100 |
commit | 25f22702f153d62b55cb276152ba5ea935023e6e (patch) | |
tree | d93d342c3e7f124df94215a855ca4b99d93012fe /kern/sched_prim.c | |
parent | dc5486ba8801625069fc6172b03e897612f42a90 (diff) | |
download | gnumach-25f22702f153d62b55cb276152ba5ea935023e6e.tar.gz gnumach-25f22702f153d62b55cb276152ba5ea935023e6e.tar.bz2 gnumach-25f22702f153d62b55cb276152ba5ea935023e6e.zip |
Implement basic sleeping locks for gnumach
* kern/atomic.h: New file.
* kern/kmutex.h: New file.
* kern/kmutex.c: New file.
* Makefrag.am (libkernel_a_SOURCES): Add atomic.h, kmutex.h, kmutex.c.
* kern/sched_prim.h (thread_wakeup_prim): Make it return boolean_t.
* kern/sched_prim.c (thread_wakeup_prim): Return TRUE if we woke a
thread, and FALSE otherwise.
Diffstat (limited to 'kern/sched_prim.c')
-rw-r--r-- | kern/sched_prim.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kern/sched_prim.c b/kern/sched_prim.c index bb767352..173f0687 100644 --- a/kern/sched_prim.c +++ b/kern/sched_prim.c @@ -376,13 +376,14 @@ void clear_wait( * and thread_wakeup_one. * */ -void thread_wakeup_prim( +boolean_t thread_wakeup_prim( event_t event, boolean_t one_thread, int result) { queue_t q; int index; + boolean_t woke = FALSE; thread_t thread, next_th; decl_simple_lock_data( , *lock); spl_t s; @@ -435,6 +436,7 @@ void thread_wakeup_prim( break; } thread_unlock(thread); + woke = TRUE; if (one_thread) break; } @@ -442,6 +444,7 @@ void thread_wakeup_prim( } simple_unlock(lock); splx(s); + return (woke); } /* |