minor fix to rwlock.read()

This commit is contained in:
Ben Blum 2012-08-10 22:54:41 -04:00
parent 9470e5d7d5
commit 3dbce4ebea

View File

@ -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()
}