Synchronization by locks