about summary refs log tree commit diff
path: root/src/rt/rust_kernel.h
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2010-09-08 19:13:49 -0700
committerGraydon Hoare <graydon@mozilla.com>2010-09-08 19:13:49 -0700
commit616b7afb724a32df41eebfaf95402d008c60b411 (patch)
tree03e13578e8b43b9001cef983d1117800a6f93e65 /src/rt/rust_kernel.h
parent13d6f874316c9f69ab3a29f120ce410da2290a64 (diff)
downloadrust-616b7afb724a32df41eebfaf95402d008c60b411.tar.gz
rust-616b7afb724a32df41eebfaf95402d008c60b411.zip
Tidy up the sync dir, remove dead or mis-designed code in favour of OS primitives, switch rust_kernel to use a lock/signal pair and wait rather than spin.
Diffstat (limited to 'src/rt/rust_kernel.h')
-rw-r--r--src/rt/rust_kernel.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h
index db3ad0687eb..6607bdbc3a3 100644
--- a/src/rt/rust_kernel.h
+++ b/src/rt/rust_kernel.h
@@ -32,12 +32,6 @@ public:
     }
 };
 
-#define LOCK(x) x.lock();
-#define UNLOCK(x) x.unlock();
-
-#define PLOCK(x) printf("LOCKING @ %d\n", __LINE__); x.lock();
-#define PUNLOCK(x) x.unlock(); printf("UNLOCKED @ %d\n", __LINE__);
-
 /**
  * A global object shared by all thread domains. Most of the data structures
  * in this class are synchronized since they are accessed from multiple
@@ -59,9 +53,9 @@ class rust_kernel : public rust_thread {
 
     void run();
     void start_kernel_loop();
-    bool volatile _interrupt_kernel_loop;
+    bool _interrupt_kernel_loop;
 
-    spin_lock _kernel_lock;
+    lock_and_signal _kernel_lock;
 
     void terminate_kernel_loop();
     void pump_message_queues();