root / lab4 / .minix-src / include / ddekit / condvar.h @ 13
History | View | Annotate | Download (883 Bytes)
1 | 13 | up20180614 | #ifndef _ddekit_condvar_h
|
---|---|---|---|
2 | #define _ddekit_condvar_h
|
||
3 | |||
4 | /** \file ddekit/condvar.h */
|
||
5 | #include <ddekit/ddekit.h> |
||
6 | |||
7 | #include <ddekit/lock.h> |
||
8 | |||
9 | struct ddekit_condvar;
|
||
10 | typedef struct ddekit_condvar ddekit_condvar_t; |
||
11 | |||
12 | /* Initialize conditional variable. */
|
||
13 | ddekit_condvar_t * ddekit_condvar_init(void);
|
||
14 | |||
15 | /* Uninitialize conditional variable. */
|
||
16 | void ddekit_condvar_deinit(ddekit_condvar_t *cvp);
|
||
17 | |||
18 | /* Wait on a conditional variable. */
|
||
19 | void ddekit_condvar_waiti(ddekit_condvar_t *cvp, ddekit_lock_t *mp);
|
||
20 | |||
21 | /* Wait on a conditional variable at most until a timeout expires. (UNIMPL) */
|
||
22 | int ddekit_condvar_wait_timed(ddekit_condvar_t *cvp, ddekit_lock_t *mp,
|
||
23 | int timo);
|
||
24 | |||
25 | /* Send signal to the next one waiting for condvar. */
|
||
26 | void ddekit_condvar_signal(ddekit_condvar_t *cvp);
|
||
27 | |||
28 | /* Send signal to all threads waiting for condvar. */
|
||
29 | void ddekit_condvar_broadcast(ddekit_condvar_t *cvp);
|
||
30 | |||
31 | #endif |