Rev 387 | Rev 430 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 387 | Rev 404 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | /** Signal the condition has become true |
45 | /** Signal the condition has become true |
46 | * |
46 | * |
47 | * Signal the condition has become true |
47 | * Signal the condition has become true |
48 | * to the first waiting thread by waking it up. |
48 | * to the first waiting thread by waking it up. |
49 | * |
49 | * |
50 | * @param Condition variable. |
50 | * @param cv Condition variable. |
51 | */ |
51 | */ |
52 | void condvar_signal(condvar_t *cv) |
52 | void condvar_signal(condvar_t *cv) |
53 | { |
53 | { |
54 | waitq_wakeup(&cv->wq, WAKEUP_FIRST); |
54 | waitq_wakeup(&cv->wq, WAKEUP_FIRST); |
55 | } |
55 | } |
Line 57... | Line 57... | ||
57 | /** Signal the condition has become true |
57 | /** Signal the condition has become true |
58 | * |
58 | * |
59 | * Signal the condition has become true |
59 | * Signal the condition has become true |
60 | * to all waiting threads by waking them up. |
60 | * to all waiting threads by waking them up. |
61 | * |
61 | * |
62 | * @param Condition variable. |
62 | * @param cv Condition variable. |
63 | */ |
63 | */ |
64 | void condvar_broadcast(condvar_t *cv) |
64 | void condvar_broadcast(condvar_t *cv) |
65 | { |
65 | { |
66 | waitq_wakeup(&cv->wq, WAKEUP_ALL); |
66 | waitq_wakeup(&cv->wq, WAKEUP_ALL); |
67 | } |
67 | } |
68 | 68 | ||
69 | /** Wait for the condition becoming true |
69 | /** Wait for the condition becoming true |
70 | * |
70 | * |
71 | * Wait for the condition becoming true. |
71 | * Wait for the condition becoming true. |
72 | * |
72 | * |
73 | * @param Condition variable. |
73 | * @param cv Condition variable. |
- | 74 | * @param mtx Mutex. |
|
- | 75 | * @param usec Timeout value in microseconds. |
|
- | 76 | * @param trywait Blocking versus non-blocking operation mode switch. |
|
- | 77 | * |
|
- | 78 | * For exact description of possible combinations of |
|
- | 79 | * 'usec' and 'trywait', see comment for waitq_sleep_timeout(). |
|
- | 80 | * |
|
- | 81 | * @return See comment for waitq_sleep_timeout(). |
|
74 | */ |
82 | */ |
75 | int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32 usec, int trywait) |
83 | int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32 usec, int trywait) |
76 | { |
84 | { |
77 | int rc; |
85 | int rc; |
78 | 86 |