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/memory_region.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/rt/memory_region.h') 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 _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 */ -- cgit v1.2.3