completed the thread code Learned_Synchrony_worker.c