Skip to content

Commit

Permalink
Improve the documentation for client/server synchronization.
Browse files Browse the repository at this point in the history
On Unix we use a fcntl() lock, not flock(), and on Windows we use LockFileEx.

PiperOrigin-RevId: 693314236
Change-Id: I6facfe2da1c2ece0bf75b6a815f73301e2db64b0
  • Loading branch information
tjgq authored and copybara-github committed Nov 5, 2024
1 parent 1f0db43 commit 540958d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/cpp/blaze.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ using std::vector;
// The following is a treatise on how the interaction between the client and the
// server works.
//
// First, the client unconditionally acquires an flock() lock on
// $OUTPUT_BASE/lock then verifies if it has already extracted itself by
// First, the client acquires a lock on $OUTPUT_BASE/lock (on Unix, we use
// fcntl(F_OFD_SETLK) if available or fcntl(F_SETLK) otherwise; on Windows, we
// use LockFileEx), blocking until it's available unless otherwise requested by
// the startup options. Then it verifies if it has already extracted itself by
// checking if the directory it extracts itself to (install base + a checksum)
// is present. If not, then it does the extraction. Care is taken that this
// process is atomic so that Blazen in multiple output bases do not clash.
Expand Down

0 comments on commit 540958d

Please sign in to comment.