瀏覽代碼

Fix doc gen for atomics, conditions and semaphores. (#10949)

Fixes https://github.com/HaxeFoundation/haxe/issues/10948
Fixes https://github.com/HaxeFoundation/haxe/issues/10947
Zeta 2 年之前
父節點
當前提交
569b486684

+ 0 - 1
std/cpp/_std/haxe/atomic/AtomicInt.hx

@@ -1,6 +1,5 @@
 package haxe.atomic;
 package haxe.atomic;
 
 
-@:noDoc
 #if cppia
 #if cppia
 extern
 extern
 #end
 #end

+ 0 - 1
std/cpp/_std/sys/thread/Condition.hx

@@ -1,6 +1,5 @@
 package sys.thread;
 package sys.thread;
 
 
-@:noDoc
 @:coreApi
 @:coreApi
 class Condition {
 class Condition {
 	var c:Dynamic;
 	var c:Dynamic;

+ 0 - 1
std/cpp/_std/sys/thread/Semaphore.hx

@@ -1,6 +1,5 @@
 package sys.thread;
 package sys.thread;
 
 
-@:noDoc
 @:coreApi
 @:coreApi
 class Semaphore {
 class Semaphore {
 	var m:Dynamic;
 	var m:Dynamic;

+ 1 - 2
std/cs/_std/haxe/atomic/AtomicInt.hx

@@ -8,8 +8,7 @@ private class IntWrapper {
 	}
 	}
 }
 }
 
 
-@:noDoc
-abstract AtomicInt(IntWrapper) to IntWrapper {
+abstract AtomicInt(IntWrapper) {
 	public inline function new(value:Int) {
 	public inline function new(value:Int) {
 		this = new IntWrapper(value);
 		this = new IntWrapper(value);
 	}
 	}

+ 0 - 1
std/cs/_std/sys/thread/Condition.hx

@@ -2,7 +2,6 @@ package sys.thread;
 
 
 import cs.system.threading.Monitor;
 import cs.system.threading.Monitor;
 
 
-@:noDoc
 @:coreApi
 @:coreApi
 @:access(sys.thread.Mutex)
 @:access(sys.thread.Mutex)
 class Condition {
 class Condition {

+ 0 - 1
std/cs/_std/sys/thread/Semaphore.hx

@@ -1,6 +1,5 @@
 package sys.thread;
 package sys.thread;
 
 
-@:noDoc
 @:coreApi
 @:coreApi
 class Semaphore {
 class Semaphore {
 	final native:cs.system.threading.Semaphore;
 	final native:cs.system.threading.Semaphore;

+ 0 - 1
std/eval/_std/sys/thread/Condition.hx

@@ -1,6 +1,5 @@
 package sys.thread;
 package sys.thread;
 
 
-@:noDoc
 @:coreApi class Condition {
 @:coreApi class Condition {
 	final cond:eval.luv.Condition;
 	final cond:eval.luv.Condition;
 	final mutex:eval.luv.Mutex;
 	final mutex:eval.luv.Mutex;

+ 0 - 1
std/eval/_std/sys/thread/Semaphore.hx

@@ -1,6 +1,5 @@
 package sys.thread;
 package sys.thread;
 
 
-@:noDoc
 @:coreApi class Semaphore {
 @:coreApi class Semaphore {
 	final native:eval.luv.Semaphore;
 	final native:eval.luv.Semaphore;
 
 

+ 0 - 1
std/haxe/atomic/AtomicInt.hx

@@ -8,7 +8,6 @@ package haxe.atomic;
 	Atomic integer.
 	Atomic integer.
 	(js) The Atomics and SharedArrayBuffer objects need to be available. Errors will be thrown if this is not the case.
 	(js) The Atomics and SharedArrayBuffer objects need to be available. Errors will be thrown if this is not the case.
 **/
 **/
-@:noDoc
 @:coreType
 @:coreType
 abstract AtomicInt {
 abstract AtomicInt {
 	public function new(value:Int):Void;
 	public function new(value:Int):Void;

+ 0 - 1
std/hl/_std/haxe/atomic/AtomicInt.hx

@@ -5,7 +5,6 @@ package haxe.atomic;
 #end
 #end
 import hl.Atomics;
 import hl.Atomics;
 
 
-@:noDoc
 abstract AtomicInt(hl.NativeArray<Int>) {
 abstract AtomicInt(hl.NativeArray<Int>) {
 	public inline function new(value:Int):Void {
 	public inline function new(value:Int):Void {
 		this = new hl.NativeArray(1);
 		this = new hl.NativeArray(1);

+ 18 - 1
std/hl/_std/sys/thread/Condition.hx

@@ -1,6 +1,22 @@
 package sys.thread;
 package sys.thread;
 
 
-@:noDoc
+#if doc_gen
+@:coreApi extern class Condition {
+	function new():Void;
+
+	public function acquire():Void;
+
+	public function tryAcquire():Bool;
+
+	public function release():Void;
+
+	public function wait():Void;
+
+	public function signal():Void;
+
+	public function broadcast():Void;
+}
+#else
 abstract Condition(hl.Abstract<"hl_condition">) {
 abstract Condition(hl.Abstract<"hl_condition">) {
 	public function new():Void {
 	public function new():Void {
 		this = alloc();
 		this = alloc();
@@ -31,3 +47,4 @@ abstract Condition(hl.Abstract<"hl_condition">) {
 		return null;
 		return null;
 	}
 	}
 }
 }
+#end

+ 9 - 1
std/hl/_std/sys/thread/Semaphore.hx

@@ -1,6 +1,13 @@
 package sys.thread;
 package sys.thread;
 
 
-@:noDoc
+#if doc_gen
+@:coreApi extern class Semaphore {
+	function new(value:Int):Void;
+	function acquire():Void;
+	function tryAcquire(?timeout:Float):Bool;
+	function release():Void;
+}
+#else
 abstract Semaphore(hl.Abstract<"hl_semaphore">) {
 abstract Semaphore(hl.Abstract<"hl_semaphore">) {
 	public function new(value:Int):Void {
 	public function new(value:Int):Void {
 		this = alloc(value);
 		this = alloc(value);
@@ -22,3 +29,4 @@ abstract Semaphore(hl.Abstract<"hl_semaphore">) {
 		return null;
 		return null;
 	}
 	}
 }
 }
+#end

+ 0 - 1
std/java/_std/haxe/atomic/AtomicInt.hx

@@ -2,7 +2,6 @@ package haxe.atomic;
 
 
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicInteger;
 
 
-@:noDoc
 abstract AtomicInt(AtomicInteger) {
 abstract AtomicInt(AtomicInteger) {
 	public inline function new(value:Int) {
 	public inline function new(value:Int) {
 		this = new AtomicInteger(value);
 		this = new AtomicInteger(value);

+ 0 - 1
std/java/_std/sys/thread/Condition.hx

@@ -3,7 +3,6 @@ package sys.thread;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.concurrent.locks.Condition as NativeCondition;
 import java.util.concurrent.locks.Condition as NativeCondition;
 
 
-@:noDoc
 @:access(sys.thread.Mutex)
 @:access(sys.thread.Mutex)
 @:coreApi
 @:coreApi
 @:native('haxe.java.vm.Condition')
 @:native('haxe.java.vm.Condition')

+ 0 - 1
std/java/_std/sys/thread/Semaphore.hx

@@ -2,7 +2,6 @@ package sys.thread;
 
 
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeUnit;
 
 
-@:noDoc
 @:coreApi
 @:coreApi
 @:native('haxe.java.vm.Semaphore')
 @:native('haxe.java.vm.Semaphore')
 class Semaphore {
 class Semaphore {

+ 14 - 11
std/js/_std/haxe/atomic/AtomicInt.hx

@@ -2,46 +2,49 @@ package haxe.atomic;
 
 
 import js.lib.Atomics;
 import js.lib.Atomics;
 
 
-@:noDoc
-abstract AtomicInt(js.lib.Int32Array) to js.lib.Int32Array {
+abstract AtomicInt(js.lib.Int32Array) {
 	public inline function new(value:Int) {
 	public inline function new(value:Int) {
 		this = new js.lib.Int32Array(new js.lib.SharedArrayBuffer(js.lib.Int32Array.BYTES_PER_ELEMENT));
 		this = new js.lib.Int32Array(new js.lib.SharedArrayBuffer(js.lib.Int32Array.BYTES_PER_ELEMENT));
 		this[0] = value;
 		this[0] = value;
 	}
 	}
 
 
+	private function asArray():js.lib.Int32Array {
+		return this;
+	}
+
 	public inline function add(b:Int):Int {
 	public inline function add(b:Int):Int {
-		return Atomics.add(this, 0, b);
+		return Atomics.add(asArray(), 0, b);
 	}
 	}
 
 
 	public inline function sub(b:Int):Int {
 	public inline function sub(b:Int):Int {
-		return Atomics.sub(this, 0, b);
+		return Atomics.sub(asArray(), 0, b);
 	}
 	}
 
 
 	public inline function and(b:Int):Int {
 	public inline function and(b:Int):Int {
-		return Atomics.and(this, 0, b);
+		return Atomics.and(asArray(), 0, b);
 	}
 	}
 
 
 	public inline function or(b:Int):Int {
 	public inline function or(b:Int):Int {
-		return Atomics.or(this, 0, b);
+		return Atomics.or(asArray(), 0, b);
 	}
 	}
 
 
 	public inline function xor(b:Int):Int {
 	public inline function xor(b:Int):Int {
-		return Atomics.xor(this, 0, b);
+		return Atomics.xor(asArray(), 0, b);
 	}
 	}
 
 
 	public inline function compareExchange(expected:Int, replacement:Int):Int {
 	public inline function compareExchange(expected:Int, replacement:Int):Int {
-		return Atomics.compareExchange(this, 0, expected, replacement);
+		return Atomics.compareExchange(asArray(), 0, expected, replacement);
 	}
 	}
 
 
 	public inline function exchange(value:Int):Int {
 	public inline function exchange(value:Int):Int {
-		return Atomics.exchange(this, 0, value);
+		return Atomics.exchange(asArray(), 0, value);
 	}
 	}
 
 
 	public inline function load():Int {
 	public inline function load():Int {
-		return Atomics.load(this, 0);
+		return Atomics.load(asArray(), 0);
 	}
 	}
 
 
 	public inline function store(value:Int):Int {
 	public inline function store(value:Int):Int {
-		return Atomics.store(this, 0, value);
+		return Atomics.store(asArray(), 0, value);
 	}
 	}
 }
 }

+ 0 - 1
std/python/_std/sys/thread/Condition.hx

@@ -1,6 +1,5 @@
 package sys.thread;
 package sys.thread;
 
 
-@:noDoc
 @:coreApi
 @:coreApi
 class Condition {
 class Condition {
 	final cond:python.lib.threading.Condition;
 	final cond:python.lib.threading.Condition;

+ 0 - 1
std/python/_std/sys/thread/Semaphore.hx

@@ -2,7 +2,6 @@ package sys.thread;
 
 
 import python.lib.threading.Semaphore as NativeSemaphore;
 import python.lib.threading.Semaphore as NativeSemaphore;
 
 
-@:noDoc
 @:coreApi
 @:coreApi
 class Semaphore {
 class Semaphore {
 	final semaphore:NativeSemaphore;
 	final semaphore:NativeSemaphore;

+ 0 - 1
std/sys/thread/Condition.hx

@@ -10,7 +10,6 @@ package sys.thread;
 	until another thread modifies a shared variable (the condition)
 	until another thread modifies a shared variable (the condition)
 	and signals the condition variable.
 	and signals the condition variable.
 **/
 **/
-@:noDoc
 @:coreApi extern class Condition {
 @:coreApi extern class Condition {
 	/**
 	/**
 		Create a new condition variable.
 		Create a new condition variable.

+ 0 - 1
std/sys/thread/Semaphore.hx

@@ -3,7 +3,6 @@ package sys.thread;
 #if (!target.threaded)
 #if (!target.threaded)
 #error "This class is not available on this target"
 #error "This class is not available on this target"
 #end
 #end
-@:noDoc
 @:coreApi extern class Semaphore {
 @:coreApi extern class Semaphore {
 	/**
 	/**
 		Creates a new semaphore with an initial value.
 		Creates a new semaphore with an initial value.