aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_kernel.h
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-09-08 19:13:49 -0700
committerGraydon Hoare <[email protected]>2010-09-08 19:13:49 -0700
commit616b7afb724a32df41eebfaf95402d008c60b411 (patch)
tree03e13578e8b43b9001cef983d1117800a6f93e65 /src/rt/rust_kernel.h
parentXFAIL many.rs since it crashes on win32, and add a time-slice sleep to the ke... (diff)
downloadrust-616b7afb724a32df41eebfaf95402d008c60b411.tar.xz
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 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();