Added an example for threads synchronization.