1 #include <dispatch/dispatch.h>
6 #include "dispatch_test.h"
14 dispatch_semaphore_t dsema
;
16 test_start("Dispatch Semaphore");
18 dsema
= dispatch_semaphore_create(1);
21 dispatch_apply(LAPS
, dispatch_get_concurrent_queue(0), ^(size_t idx
__attribute__((unused
))) {
22 dispatch_semaphore_wait(dsema
, DISPATCH_TIME_FOREVER
);
24 dispatch_semaphore_signal(dsema
);
27 dispatch_release(dsema
);
29 test_long("count", total
, LAPS
);