MCPcopy Create free account
hub / github.com/ZDoom/Raze / pthread_cond_init

Function pthread_cond_init

libraries/webp/src/utils/thread_utils.c:143–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143static int pthread_cond_init(pthread_cond_t* const condition, void* cond_attr) {
144 (void)cond_attr;
145#ifdef USE_WINDOWS_CONDITION_VARIABLE
146 InitializeConditionVariable(condition);
147#else
148 condition->waiting_sem_ = CreateSemaphore(NULL, 0, 1, NULL);
149 condition->received_sem_ = CreateSemaphore(NULL, 0, 1, NULL);
150 condition->signal_event_ = CreateEvent(NULL, FALSE, FALSE, NULL);
151 if (condition->waiting_sem_ == NULL ||
152 condition->received_sem_ == NULL ||
153 condition->signal_event_ == NULL) {
154 pthread_cond_destroy(condition);
155 return 1;
156 }
157#endif
158 return 0;
159}
160
161static int pthread_cond_signal(pthread_cond_t* const condition) {
162 int ok = 1;

Callers 3

ResetFunction · 0.85
Event_CreateFunction · 0.85
Semaphore_CreateFunction · 0.85

Calls 1

pthread_cond_destroyFunction · 0.85

Tested by

no test coverage detected