MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / pthread_barrier_wait

Function pthread_barrier_wait

lib/hidapi/mac/hid.c:85–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85static int pthread_barrier_wait(pthread_barrier_t *barrier)
86{
87 pthread_mutex_lock(&barrier->mutex);
88 ++(barrier->count);
89 if(barrier->count >= barrier->trip_count)
90 {
91 barrier->count = 0;
92 pthread_cond_broadcast(&barrier->cond);
93 pthread_mutex_unlock(&barrier->mutex);
94 return 1;
95 }
96 else
97 {
98 pthread_cond_wait(&barrier->cond, &(barrier->mutex));
99 pthread_mutex_unlock(&barrier->mutex);
100 return 0;
101 }
102}
103
104static int return_data(hid_device *dev, unsigned char *data, size_t length);
105

Callers 3

read_threadFunction · 0.70
hid.cFile · 0.70
hid_closeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected