about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libstd/sync.rs3
1 files changed, 2 insertions, 1 deletions
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 @@ impl &rwlock {
      * tasks may run concurrently with this one.
      */
     fn read<U>(blk: fn() -> U) -> U {
+        let mut release = none;
         unsafe {
             do task::unkillable {
                 do (&self.order_lock).access {
@@ -328,9 +329,9 @@ impl &rwlock {
                         (&self.access_lock).acquire();
                     }
                 }
+                release = some(rwlock_release_read(self));
             }
         }
-        let _z = rwlock_release_read(self);
         blk()
     }