Browse Source

Do not require HXCPP_MULTI_THREADED

Hugh Sanderson 14 years ago
parent
commit
2eca5459cd
6 changed files with 18 additions and 22 deletions
  1. 0 4
      std/cpp/vm/Deque.hx
  2. 17 0
      std/cpp/vm/Gc.hx
  3. 0 4
      std/cpp/vm/Lock.hx
  4. 0 5
      std/cpp/vm/Mutex.hx
  5. 1 4
      std/cpp/vm/Thread.hx
  6. 0 5
      std/cpp/vm/Tls.hx

+ 0 - 4
std/cpp/vm/Deque.hx

@@ -24,7 +24,6 @@
  */
  */
 package cpp.vm;
 package cpp.vm;
 
 
-#if HXCPP_MULTI_THREADED
 
 
 class Deque<T> {
 class Deque<T> {
 	var q : Dynamic;
 	var q : Dynamic;
@@ -42,6 +41,3 @@ class Deque<T> {
 	}
 	}
 }
 }
 
 
-#else
-You_need_to_define_HXCPP_MULTI_THREADED_to_use_the_Deque_class
-#end

+ 17 - 0
std/cpp/vm/Gc.hx

@@ -17,4 +17,21 @@ class Gc
       return untyped __global__.__hxcpp_gc_trace(sought,printInstances);
       return untyped __global__.__hxcpp_gc_trace(sought,printInstances);
    }
    }
 
 
+   #if gc_extra
+   // Can't add these until the next hxcpp release....
+   static public function safePoint() : Void
+   {
+      untyped __global__.__hxcpp_gc_safe_point();
+   }
+
+   static public function enterGCFreeZone() : Void
+   {
+      untyped __global__.__hxcpp_enter_gc_free_zone();
+   }
+
+   static public function exitGCFreeZone() : Void
+   {
+      untyped __global__.__hxcpp_exit_gc_free_zone();
+   }
+   #end
 }
 }

+ 0 - 4
std/cpp/vm/Lock.hx

@@ -24,7 +24,6 @@
  */
  */
 package cpp.vm;
 package cpp.vm;
 
 
-#if HXCPP_MULTI_THREADED
 
 
 class Lock {
 class Lock {
 	var l : Dynamic;
 	var l : Dynamic;
@@ -39,6 +38,3 @@ class Lock {
 	}
 	}
 }
 }
 
 
-#else
-You_need_to_define_HXCPP_MULTI_THREADED_to_use_the_Lock_class
-#end

+ 0 - 5
std/cpp/vm/Mutex.hx

@@ -24,8 +24,6 @@
  */
  */
 package cpp.vm;
 package cpp.vm;
 
 
-#if HXCPP_MULTI_THREADED
-
 class Mutex {
 class Mutex {
 	var m : Dynamic;
 	var m : Dynamic;
 
 
@@ -43,6 +41,3 @@ class Mutex {
 	}
 	}
 }
 }
 
 
-#else
-You_need_to_define_HXCPP_MULTI_THREADED_to_use_the_Mutex_class
-#end

+ 1 - 4
std/cpp/vm/Thread.hx

@@ -26,7 +26,6 @@ package cpp.vm;
 
 
 typedef ThreadHandle = Dynamic;
 typedef ThreadHandle = Dynamic;
 
 
-#if HXCPP_MULTI_THREADED
 class Thread {
 class Thread {
 
 
 	var handle : ThreadHandle;
 	var handle : ThreadHandle;
@@ -71,6 +70,4 @@ class Thread {
 	}
 	}
 
 
 }
 }
-#else
-You_need_to_define_HXCPP_MULTI_THREADED_to_use_the_Thread_class
-#end
+

+ 0 - 5
std/cpp/vm/Tls.hx

@@ -24,8 +24,6 @@
  */
  */
 package cpp.vm;
 package cpp.vm;
 
 
-#if HXCPP_MULTI_THREADED
-
 class Tls<T> {
 class Tls<T> {
 
 
 	static var sFreeSlot = 0;
 	static var sFreeSlot = 0;
@@ -47,6 +45,3 @@ class Tls<T> {
 
 
 }
 }
 
 
-#else
-You_need_to_define_HXCPP_MULTI_THREADED_to_use_the_Tls_class
-#end