about summary refs log tree commit diff
path: root/src/rt/rust_kernel.h
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-02-04 00:03:45 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-04 00:31:43 -0800
commit9fa950ec53dc7428d2d4a20ba56a50c21d5606a5 (patch)
treebe3fb16701844926dedc6b60d36ced2d1360ea25 /src/rt/rust_kernel.h
parent21d783c33844028d8baa0d4d022fc244fc3ba77b (diff)
downloadrust-9fa950ec53dc7428d2d4a20ba56a50c21d5606a5.tar.gz
rust-9fa950ec53dc7428d2d4a20ba56a50c21d5606a5.zip
rt: Stop using atomic ops on rust_kernel::live_tasks
These ops are all done within spitting distance of a suitable lock,
so just protect it with the lock.
Diffstat (limited to 'src/rt/rust_kernel.h')
-rw-r--r--src/rt/rust_kernel.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h
index ff892aea303..917444b2bbd 100644
--- a/src/rt/rust_kernel.h
+++ b/src/rt/rust_kernel.h
@@ -22,12 +22,13 @@ public:
 private:
     rust_scheduler *sched;
 
+    // Protects live_tasks, max_task_id and task_table
+    lock_and_signal task_lock;
     // Tracks the number of tasks that are being managed by
     // schedulers. When this hits 0 we will tell all schedulers
     // to exit.
-    volatile int live_tasks;
-    // Protects max_task_id and task_table
-    lock_and_signal task_lock;
+    int live_tasks;
+    // The next task id
     rust_task_id max_task_id;
     hash_map<rust_task_id, rust_task *> task_table;