This commit is contained in:
Dante
2026-05-21 23:40:20 -07:00
parent 3e2915dff7
commit 877a69d844
5737 changed files with 29796 additions and 1589684 deletions

View File

@ -105,9 +105,7 @@ class Process {
}
public function exitCode(block:Bool = true):Null<Int> {
if (block == false)
throw "Non blocking exitCode() not supported on this platform";
return NativeProcess.process_exit(p);
return NativeProcess.process_exit(p, block);
}
public function close():Void {

View File

@ -0,0 +1,33 @@
package sys.thread;
@:coreApi
class Condition {
var c:Dynamic;
public function new():Void {
c = untyped __global__.__hxcpp_condition_create();
}
public function acquire():Void {
untyped __global__.__hxcpp_condition_acquire(c);
}
public function tryAcquire():Bool {
return untyped __global__.__hxcpp_condition_try_acquire(c);
}
public function release():Void {
untyped __global__.__hxcpp_condition_release(c);
}
public function wait():Void {
untyped __global__.__hxcpp_condition_wait(c);
}
public function signal():Void {
untyped __global__.__hxcpp_condition_signal(c);
}
public function broadcast():Void {
untyped __global__.__hxcpp_condition_broadcast(c);
}
}

View File

@ -0,0 +1,22 @@
package sys.thread;
@:coreApi
class Semaphore {
var m:Dynamic;
public function new(value:Int) {
m = untyped __global__.__hxcpp_semaphore_create(value);
}
public function acquire():Void {
untyped __global__.__hxcpp_semaphore_acquire(m);
}
public function tryAcquire(?timeout:Float):Bool {
return untyped __global__.__hxcpp_semaphore_try_acquire(m, timeout == null ? 0 : (timeout:Float));
}
public function release():Void {
untyped __global__.__hxcpp_semaphore_release(m);
}
}