about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-12-15 22:19:34 -0800
committerAlex Crichton <alex@alexcrichton.com>2013-12-24 19:59:54 -0800
commit962af9198f8f2a1e2d5121ac216b6f4d574ae54c (patch)
treef990add092e17494929ab8c875254009f58ba069 /src/libstd
parent04c446b4b66068a6742d29cd34326e520373f83e (diff)
downloadrust-962af9198f8f2a1e2d5121ac216b6f4d574ae54c.tar.gz
rust-962af9198f8f2a1e2d5121ac216b6f4d574ae54c.zip
native: Protect against spurious wakeups on cvars
This is a very real problem with cvars on normal systems, and all of channels
will not work if spurious wakeups are accepted. This problem is just solved with
a synchronized flag (accessed in the cvar's lock) to see whether a signal()
actually happened or whether it's spurious.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/comm/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/comm/mod.rs b/src/libstd/comm/mod.rs
index 7b464bc2f32..ae440894b4e 100644
--- a/src/libstd/comm/mod.rs
+++ b/src/libstd/comm/mod.rs
@@ -875,7 +875,7 @@ impl<T: Send> Port<T> {
         let data = self.try_recv_inc(false);
         if data.is_none() &&
            unsafe { (*packet).cnt.load(SeqCst) } != DISCONNECTED {
-            fail!("bug: woke up too soon");
+            fail!("bug: woke up too soon {}", unsafe { (*packet).cnt.load(SeqCst) });
         }
         return data;
     }