// odd/even thread coordination on incrementing an global // variable. This version involves busy waiting on the odd/even // condition by checking odd/even first, then locking, then // re-checking. #include "odds_evens.h" int count = 0; // global variable all threads are modifiying pthread_mutex_t count_mutex; // mutex to check count // Run by even child threads, increment count when it is even void *even_work(void *t) { int tid = *( (int *) t); for(int i=0; i