about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorBen Blum <bblum@andrew.cmu.edu>2012-08-24 17:26:42 -0400
committerBen Blum <bblum@andrew.cmu.edu>2012-08-24 18:28:26 -0400
commit5ba7434cb17c19438b00730b37741f2d61449ad8 (patch)
tree6d22ee9fadd01984af043c2a78a32b2ef27bd8e3 /src/rt/rust_task.cpp
parente55c5ceac239417784f9fe8c37f92e974b9cc06e (diff)
downloadrust-5ba7434cb17c19438b00730b37741f2d61449ad8.tar.gz
rust-5ba7434cb17c19438b00730b37741f2d61449ad8.zip
Avoid lifecycle_lock traffic in call_on_rust_stack. (close #3270)
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 791c6a6551f..8bcf1b06133 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -248,6 +248,13 @@ MUST_CHECK bool rust_task::yield() {
 
     // This check is largely superfluous; it's the one after the context swap
     // that really matters. This one allows us to assert a useful invariant.
+
+    // NB: This takes lifecycle_lock three times, and I believe that none of
+    // them are actually necessary, as per #3213. Removing the locks here may
+    // cause *harmless* races with a killer... but I didn't observe any
+    // substantial performance improvement from removing them, even with
+    // msgsend-ring-pipes, and also it's my last day, so I'm not about to
+    // remove them.  -- bblum
     if (must_fail_from_being_killed()) {
         {
             scoped_lock with(lifecycle_lock);