Skip to content
Commit 28c51254 authored by Emanuel Krivoy's avatar Emanuel Krivoy Committed by Chromium LUCI CQ
Browse files

Switch to refcounted locks, add shared locks for writable streams

This CL changes the scope of the WriteLockManager, making it responsible
for the creation of locks, instead of owning access handle and file
writer receivers. This simplifies error handling and avoids unnecessary
IO operations when taking a lock is not possible. This new locks are
refcounted, when there are no more references to them, their
destructor releases the lock on the URL.

Creating access handles requires an exclusive lock, which prevent any
other lock from being taken on the URL. Creating writable streams
requires a shared lock, which prevent the taking of exclusive locks, but
allow the taking of shared ones.

Bug: 1218431
Change-Id: I9c21b901ed0f5f331682c8a6b75db5e28674e5a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3100189


Commit-Queue: Emanuel Krivoy <krivoy@google.com>
Reviewed-by: default avatarAustin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#918766}
parent 478dfd8d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment