Synchronization between main thread + horse threads