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

Function pthread_barrier_init

lib/hidapi/mac/hid.c:56–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54} pthread_barrier_t;
55
56static int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count)
57{
58 (void) attr;
59
60 if(count == 0) {
61 errno = EINVAL;
62 return -1;
63 }
64
65 if(pthread_mutex_init(&barrier->mutex, 0) < 0) {
66 return -1;
67 }
68 if(pthread_cond_init(&barrier->cond, 0) < 0) {
69 pthread_mutex_destroy(&barrier->mutex);
70 return -1;
71 }
72 barrier->trip_count = count;
73 barrier->count = 0;
74
75 return 0;
76}
77
78static int pthread_barrier_destroy(pthread_barrier_t *barrier)
79{

Callers 1

new_hid_deviceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected