commit | 1cf421f2043e8d6765fc2aab61814365e99c32e1 | [log] [tgz] |
---|---|---|
author | Victor Costan <[email protected]> | Mon Jan 28 19:35:59 2019 |
committer | Commit Bot <[email protected]> | Mon Jan 28 19:35:59 2019 |
tree | 6f82f2b99e6f5be89e13d8ff2ec451b4f7d63749 | |
parent | 550716704af359b32448e2f3e88150c4619e34ec [diff] |
base: Add shared lock support to base::File::Lock(). base::File::{Lock, Unlock}() currently always take exclusive locks. This isn't sufficient for implementing some locking protocols, such as the protocol used by SQLite to coordinate access to its database files. We currently get away with this functionality gap because Chrome uses SQLite's built-in VFS implementations, which bypass base::File and access the underlying libraries directly. However, shared lock support becomes necessary if we want to implement a SQLite VFS on top of base::File. Fortunately, all underlying platforms support requesting both shared and exclusive locks on files. This CL exposes this support by adding a bit of plumbing and corresponding tests. Bug: 925739 Change-Id: I9934a9cbfdba3a9ad158486c48ab10a763a1a498 Reviewed-on: https://chromium-review.googlesource.com/c/1438122 Commit-Queue: Victor Costan <[email protected]> Reviewed-by: Gabriel Charette <[email protected]> Cr-Commit-Position: refs/heads/master@{#626672}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .