| 80 | } |
| 81 | |
| 82 | int pthread_cond_init(pthread_cond_t *cond, const void *unused) |
| 83 | { |
| 84 | cond->waiters = 0; |
| 85 | cond->was_broadcast = 0; |
| 86 | InitializeCriticalSection(&cond->waiters_lock); |
| 87 | |
| 88 | cond->sema = CreateSemaphore(NULL, 0, LONG_MAX, NULL); |
| 89 | if (!cond->sema) |
| 90 | die("CreateSemaphore() failed"); |
| 91 | |
| 92 | cond->continue_broadcast = CreateEvent(NULL, /* security */ |
| 93 | FALSE, /* auto-reset */ |
| 94 | FALSE, /* not signaled */ |
| 95 | NULL); /* name */ |
| 96 | if (!cond->continue_broadcast) |
| 97 | die("CreateEvent() failed"); |
| 98 | |
| 99 | return 0; |
| 100 | } |
| 101 | |
| 102 | int pthread_cond_destroy(pthread_cond_t *cond) |
| 103 | { |
no test coverage detected
searching dependent graphs…