Thread synchronization implemented with ping-pong structure.