We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0b793ea + bbbdd10 commit 22ed381Copy full SHA for 22ed381
src/libstd/sync/rwlock.rs
@@ -130,7 +130,15 @@ pub struct RwLockWriteGuard<'a, T: 'a> {
130
impl<'a, T> !marker::Send for RwLockWriteGuard<'a, T> {}
131
132
impl<T: Send + Sync> RwLock<T> {
133
- /// Creates a new instance of an RwLock which is unlocked and read to go.
+ /// Creates a new instance of an `RwLock<T>` which is unlocked.
134
+ ///
135
+ /// # Examples
136
137
+ /// ```
138
+ /// use std::sync::RwLock;
139
140
+ /// let lock = RwLock::new(5);
141
142
#[stable]
143
pub fn new(t: T) -> RwLock<T> {
144
RwLock { inner: box RW_LOCK_INIT, data: UnsafeCell::new(t) }
0 commit comments