Changeset 5c8ba05 in mainline for kernel/generic/include/synch/waitq.h


Ignore:
Timestamp:
2007-05-07T18:52:24Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6fa4888b
Parents:
4f42d52
Message:

Cleanup the waitq_wakeup() interface.
Replace numeric constants (i.e. 0)
and boolean constants (i.e. false) with
more readable WAKEUP_FIRST. Also change the
type of the second argument of waitq_wakeup()
to a newly introduced type wakeup_mode_t.

Fix behaviour of waitq_wakeup() in case
that WAKEUP_ALL semantics is required
but no threads are sleeping in the wait
queue. This is a similar fix to that of
Jan Hudecek committed in the RCU branch,
but, IMHO, is more straightforward and
also doesn't eat up previous missed
wakeups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/synch/waitq.h

    r4f42d52 r5c8ba05  
    4141#include <adt/list.h>
    4242
    43 #define WAKEUP_FIRST    0
    44 #define WAKEUP_ALL      1
     43typedef enum {
     44        WAKEUP_FIRST = 0,
     45        WAKEUP_ALL
     46} wakeup_mode_t;
    4547
    4648/** Wait queue structure. */
     
    7173extern int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags);
    7274extern void waitq_sleep_finish(waitq_t *wq, int rc, ipl_t ipl);
    73 extern void waitq_wakeup(waitq_t *wq, bool all);
    74 extern void _waitq_wakeup_unsafe(waitq_t *wq, bool all);
     75extern void waitq_wakeup(waitq_t *wq, wakeup_mode_t mode);
     76extern void _waitq_wakeup_unsafe(waitq_t *wq, wakeup_mode_t mode);
    7577extern void waitq_interrupt_sleep(struct thread *t);
    7678
Note: See TracChangeset for help on using the changeset viewer.