diff options
| author | John Gallagher <jgallagher@bignerdranch.com> | 2015-05-06 11:47:30 -0400 |
|---|---|---|
| committer | John Gallagher <jgallagher@bignerdranch.com> | 2015-05-06 11:47:30 -0400 |
| commit | 833fc273a7e63edea4f44e18112facdafe9185f6 (patch) | |
| tree | c22f3dead96c1cb28e8336a4d203afe985e8d158 /src/libstd | |
| parent | 30b883b93f94be643e4b29e32bc8dcdbf07bf1d9 (diff) | |
| download | rust-833fc273a7e63edea4f44e18112facdafe9185f6.tar.gz rust-833fc273a7e63edea4f44e18112facdafe9185f6.zip | |
Update documentation for RwLock::try_{read,write}.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 9563f6f8213..d70c0a4b438 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -171,14 +171,16 @@ impl<T: ?Sized> RwLock<T> { RwLockReadGuard::new(&*self.inner, &self.data) } - /// Attempts to acquire this lock with shared read access. + /// Attempts to acquire this rwlock with shared read access. + /// + /// If the access could not be granted at this time, then `Err` is returned. + /// Otherwise, an RAII guard is returned which will release the shared access + /// when it is dropped. + /// + /// This function does not block. /// - /// This function will never block and will return immediately if `read` - /// would otherwise succeed. Returns `Some` of an RAII guard which will - /// release the shared access of this thread when dropped, or `None` if the - /// access could not be granted. This method does not provide any - /// guarantees with respect to the ordering of whether contentious readers - /// or writers will acquire the lock first. + /// This function does not provide any guarantees with respect to the ordering + /// of whether contentious readers or writers will acquire the lock first. /// /// # Failure /// @@ -219,9 +221,14 @@ impl<T: ?Sized> RwLock<T> { /// Attempts to lock this rwlock with exclusive write access. /// - /// This function does not ever block, and it will return `None` if a call - /// to `write` would otherwise block. If successful, an RAII guard is - /// returned. + /// If the lock could not be acquired at this time, then `Err` is returned. + /// Otherwise, an RAII guard is returned which will release the lock when + /// it is dropped. + /// + /// This function does not block. + /// + /// This function does not provide any guarantees with respect to the ordering + /// of whether contentious readers or writers will acquire the lock first. /// /// # Failure /// |
