Use pthread_cond instead of usleep (silly me)