#include <stdio.h> #include <pthread.h> pthread_mutex_t a = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t b = PTHREAD_MUTEX_INITIALIZER; pthread_barrier_t bar;
void *ba_lock(void *arg) { int ret, i; pthread_mutex_lock(&b); if (pthread_barrier_wait(&bar) == PTHREAD_BARRIER_SERIAL_THREAD) pthread_barrier_destroy(&bar); pthread_mutex_lock(&a); pthread_mutex_unlock(&a); pthread_mutex_unlock(&b); }Contributors
Person | Tokens | Prop | Commits | CommitProp | |
alfredo alvarez fernandez | alfredo alvarez fernandez | 55 | 100.00% | 1 | 100.00% |
Total | 55 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
alfredo alvarez fernandez | alfredo alvarez fernandez | 96 | 100.00% | 1 | 100.00% |
Total | 96 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
alfredo alvarez fernandez | alfredo alvarez fernandez | 170 | 100.00% | 1 | 100.00% |
Total | 170 | 100.00% | 1 | 100.00% |