changed to pthread_cond_timedwait
lab5rc1