aboutsummaryrefslogtreecommitdiff
path: root/src/rt/memory_region.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/memory_region.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/memory_region.h')
-rw-r--r--src/rt/memory_region.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/rt/memory_region.h b/src/rt/memory_region.h
index affdd8f9..b62f0f51 100644
--- a/src/rt/memory_region.h
+++ b/src/rt/memory_region.h
@@ -9,7 +9,7 @@
#ifndef MEMORY_REGION_H
#define MEMORY_REGION_H
-#include "sync/spin_lock.h"
+#include "sync/lock_and_signal.h"
class rust_srv;
@@ -20,7 +20,7 @@ private:
size_t _live_allocations;
array_list<void *> _allocation_list;
const bool _synchronized;
- spin_lock _lock;
+ lock_and_signal _lock;
public:
enum memory_region_type {
LOCAL = 0x1, SYNCHRONIZED = 0x2
@@ -42,4 +42,15 @@ inline void *operator new(size_t size, memory_region *region) {
return region->malloc(size);
}
+//
+// Local Variables:
+// mode: C++
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// compile-command: "make -k -C .. 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
+// End:
+//
+
#endif /* MEMORY_REGION_H */