about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-03-02 17:10:14 -0800
committerBrian Anderson <banderson@mozilla.com>2012-03-02 17:10:14 -0800
commited7d25bb6d9955a867b2c2467a44c9e69bbc7f2e (patch)
treeaf5d971ea87272dcec263ca536290b33786210c5 /src/rt
parent04d9cc18a569f5d8a8b7c2c07a42259af41d7cb3 (diff)
downloadrust-ed7d25bb6d9955a867b2c2467a44c9e69bbc7f2e.tar.gz
rust-ed7d25bb6d9955a867b2c2467a44c9e69bbc7f2e.zip
rt: Checking port_table.is_empty() requires a lock
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_task.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 756dc0fbc4d..952e5c8c47d 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -108,7 +108,12 @@ void
 rust_task::delete_this()
 {
     I(thread, !thread->lock.lock_held_by_current_thread());
-    I(thread, port_table.is_empty());
+
+    {
+        scoped_lock with (lock);
+        I(thread, port_table.is_empty());
+    }
+
     DLOG(thread, task, "~rust_task %s @0x%" PRIxPTR ", refcnt=%d",
          name, (uintptr_t)this, ref_count);