Sample of thread synchronization