Subversion Repositories HelenOS

Rev

Rev 2131 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2131 Rev 2308
Line 38... Line 38...
38
#include <arch/types.h>
38
#include <arch/types.h>
39
#include <synch/spinlock.h>
39
#include <synch/spinlock.h>
40
#include <synch/synch.h>
40
#include <synch/synch.h>
41
#include <adt/list.h>
41
#include <adt/list.h>
42
 
42
 
-
 
43
 
-
 
44
/** Specifies behavior of the waitq_wakeup */
-
 
45
typedef enum {
-
 
46
    WAKEUP_FIRST = 0,           /**< Wakes up only the first sleeping thread, if there
-
 
47
                                   aren't any sleeping threads increments missed wakeups */
-
 
48
    WAKEUP_ALL = 1,             /**< Wakes up all sleeping threads AND zeroes out
43
#define WAKEUP_FIRST    0
49
                                   missed_wakeups */
-
 
50
    WAKEUP_ALL_INC_MISSED,      /**< Wakes up all sleeping threads OR increments
-
 
51
                                   missed_wakeups if there aren't any */
44
#define WAKEUP_ALL  1
52
} wakeup_all_flag_t;
-
 
53
 
45
 
54
 
46
/** Wait queue structure. */
55
/** Wait queue structure. */
47
typedef struct {
56
typedef struct {
48
 
57
 
49
    /** Lock protecting wait queue structure.
58
    /** Lock protecting wait queue structure.
Line 68... Line 77...
68
extern void waitq_initialize(waitq_t *wq);
77
extern void waitq_initialize(waitq_t *wq);
69
extern int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags);
78
extern int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags);
70
extern ipl_t waitq_sleep_prepare(waitq_t *wq);
79
extern ipl_t waitq_sleep_prepare(waitq_t *wq);
71
extern int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags);
80
extern int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags);
72
extern void waitq_sleep_finish(waitq_t *wq, int rc, ipl_t ipl);
81
extern void waitq_sleep_finish(waitq_t *wq, int rc, ipl_t ipl);
73
extern void waitq_wakeup(waitq_t *wq, bool all);
82
extern void waitq_wakeup(waitq_t *wq, int all);
74
extern void _waitq_wakeup_unsafe(waitq_t *wq, bool all);
83
extern void _waitq_wakeup_unsafe(waitq_t *wq, int all);
75
extern void waitq_interrupt_sleep(struct thread *t);
84
extern void waitq_interrupt_sleep(struct thread *t);
76
 
85
 
77
#endif
86
#endif
78
 
87
 
79
/** @}
88
/** @}