-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Description
An optional virtual thread support can be added for the Java target. (JDK 21+)
Here is extern:
package jvm.lang;
import java.lang.Runnable;
@:native("java.lang.Thread")
extern class Thread {
public static function startVirtualThread(task:Job):Thread;
public static function currentThread():Thread;
public function isVirtual():Bool;
}
private abstract Job(Runnable) from Runnable to Runnable {
public inline function new(job:() -> Void) {
this = cast job;
}
}System Thread implementation: https://github.com/HaxeFoundation/haxe/blob/cefabb12021d27ab56ed3f1c75667318831f09f6/std/jvm/_std/sys/thread/Thread.hx