Skip to content

Commit 3dbce4e

Browse files
committed
minor fix to rwlock.read()
1 parent 9470e5d commit 3dbce4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libstd/sync.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ impl &rwlock {
315315
* tasks may run concurrently with this one.
316316
*/
317317
fn read<U>(blk: fn() -> U) -> U {
318+
let mut release = none;
318319
unsafe {
319320
do task::unkillable {
320321
do (&self.order_lock).access {
@@ -328,9 +329,9 @@ impl &rwlock {
328329
(&self.access_lock).acquire();
329330
}
330331
}
332+
release = some(rwlock_release_read(self));
331333
}
332334
}
333-
let _z = rwlock_release_read(self);
334335
blk()
335336
}
336337

0 commit comments

Comments
 (0)