From 3dbce4ebea8b36c873b1b29e5a56d5a8b86feee6 Mon Sep 17 00:00:00 2001 From: Ben Blum Date: Fri, 10 Aug 2012 22:54:41 -0400 Subject: [PATCH] minor fix to rwlock.read() --- src/libstd/sync.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index 575412825e1..3ca0d43d985 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -315,6 +315,7 @@ fn clone() -> rwlock { * tasks may run concurrently with this one. */ fn read(blk: fn() -> U) -> U { + let mut release = none; unsafe { do task::unkillable { do (&self.order_lock).access { @@ -328,9 +329,9 @@ fn read(blk: fn() -> U) -> U { (&self.access_lock).acquire(); } } + release = some(rwlock_release_read(self)); } } - let _z = rwlock_release_read(self); blk() } -- GitLab