Lines Matching refs:sync
29 #define CHILD_FAIL_IF(x, sync) \ argument
34 (sync)->child_gave_up = true; \
35 prod_parent(sync); \
40 #define PARENT_FAIL_IF(x, sync) \ argument
45 (sync)->parent_gave_up = true; \
46 prod_child(sync); \
51 #define PARENT_SKIP_IF_UNSUPPORTED(x, sync, msg) \ argument
54 (sync)->parent_gave_up = true; \
55 prod_child(sync); \
60 int init_child_sync(struct child_sync *sync) in init_child_sync() argument
64 ret = sem_init(&sync->sem_parent, 1, 0); in init_child_sync()
70 ret = sem_init(&sync->sem_child, 1, 0); in init_child_sync()
79 void destroy_child_sync(struct child_sync *sync) in destroy_child_sync() argument
81 sem_destroy(&sync->sem_parent); in destroy_child_sync()
82 sem_destroy(&sync->sem_child); in destroy_child_sync()
85 int wait_child(struct child_sync *sync) in wait_child() argument
90 ret = sem_wait(&sync->sem_parent); in wait_child()
96 return sync->child_gave_up; in wait_child()
99 int prod_child(struct child_sync *sync) in prod_child() argument
104 ret = sem_post(&sync->sem_child); in prod_child()
113 int wait_parent(struct child_sync *sync) in wait_parent() argument
118 ret = sem_wait(&sync->sem_child); in wait_parent()
124 return sync->parent_gave_up; in wait_parent()
127 int prod_parent(struct child_sync *sync) in prod_parent() argument
132 ret = sem_post(&sync->sem_parent); in prod_parent()