Locks the specified file segment. If the file segment is already locked
by another process, waits until the existing lock is released.
Note that this is a per-process lock. This locking mechanism should
not be used for thread-level synchronization. For that, use the synchronized statement.
Locks the specified file segment. If the file segment is already locked by another process, waits until the existing lock is released.
Note that this is a per-process lock. This locking mechanism should not be used for thread-level synchronization. For that, use the synchronized statement.