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:Austin Sullivan <asully@chromium.org> Cr-Commit-Position: refs/heads/main@{#918766}
Loading
Please register or sign in to comment