From 616b7afb724a32df41eebfaf95402d008c60b411 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 8 Sep 2010 19:13:49 -0700 Subject: 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. --- src/rt/rust_kernel.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/rt/rust_kernel.h') diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h index db3ad068..6607bdbc 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(); -- cgit v1.2.3