Skip to content

Fix file locking with retry and timeout on Windows

Johannes Sixt git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4lockfile: replace random() by rand()lockfile.c+2 -20 replies
2/4help.c: wrap wait-only poll() invocation in sleep_millisec()cache.h help.c wrapper.c+7 -10 replies
3/4lockfile: convert retry timeout computations to millisecondlockfile.c+8 -130 replies
4/4lockfile: wait using sleep_millisec() instead of select()lockfile.c+1 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Fix file locking with retry and timeout on Windows

The first patch is the same that I posted earlier. It fixes a build failure on Windows on master due to missing random/srandom.

The remaining 3 patches replace the select() invocation that waits for a short time period by the version with poll() that we already use in help.c. This is necessary because a select() call where all three sets of file descriptors are empty is not supported on Windows.

Johannes Sixt (4):
lockfile: replace random() by rand()
help.c: wrap wait-only poll() invocation in sleep_millisec()
lockfile: convert retry timeout computations to millisecond
lockfile: wait using sleep_millisec() instead of select()

 cache.h    |  1 +
 help.c     |  2 +-
 lockfile.c | 31 +++++++++----------------------
 wrapper.c  |  5 +++++
 4 files changed, 16 insertions(+), 23 deletions(-)
Signature · 1 line
2.3.2.245.gb5bf9d3