Test of Thread synchronization