Reputation: 1488
In java.nio.channels.FileChannel any concurrent operations are blocked. It seems all operations are synchronized, but why do we use file lock to lock the file explicitly?
Upvotes: 1
Views: 273
Reputation: 533492
The file lock, locks the file from access by all programs.
The synchronized access to the FileChannel locks access to that object within the same program. If you use another FileChannel you can access the same file in a different thread.
Upvotes: 2