-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
Feature gate: #![feature(file_lock)]
This is a tracking issue for rust-lang/libs-team#412
This feature exposes advisory file locks on File
. They allow a file handle to acquire an exclusive or shared file lock, which blocks other file handles to the same file from acquiring a conflicting lock. Some semantics are platform dependent, and these are documented in the API documentation.
Public API
impl File {
fn lock(&self) -> io::Result<()>;
fn lock_shared(&self) -> io::Result<()>;
fn try_lock(&self) -> io::Result<bool>;
fn try_lock_shared(&self) -> io::Result<bool>;
fn unlock(&self) -> io::Result<()>;
}
Steps / History
- Implementation: Implement file_lock feature #130999
- Final comment period (FCP)1
- Signature changed due to feedback: Change signature of File::try_lock and File::try_lock_shared #139343
- Signature changed again due to feedback: Change File::try_lock() and try_lock_shared() to return io::Result<()> #140718
- Simpler error propagation: Add From<TryLockError> for io::Error #141312
- Stabilization PR: Stabilize "file_lock" feature #142125
Unresolved Questions
- None yet.
Footnotes
nazar-pc, Snowiiii, ebkalderon and stepanchegferreira-tb, starpit and teor2345Snowiiiibooniepepper
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.