| 83 | } |
| 84 | |
| 85 | static 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 | |
| 104 | static int return_data(hid_device *dev, unsigned char *data, size_t length); |
| 105 |
no outgoing calls
no test coverage detected