Update Files

This commit is contained in:
2025-01-22 16:18:30 +01:00
parent ed4603cf95
commit a36294b518
16718 changed files with 2960346 additions and 0 deletions

View File

@ -0,0 +1,40 @@
import sys.thread.Thread;
import sys.io.File;
@:cppInclude("./ThreadCode.cpp")
class Test
{
static var mainThread:Thread;
@:native("runThread")
extern static function createNativeThread():Void;
public static function callFromThread()
{
trace("Same:" + (mainThread==Thread.current()) );
mainThread.sendMessage("Done");
}
public static function main()
{
var me = Thread.current();
mainThread = me;
Thread.create( function() {
File.copy("a.txt","b.txt");
me.sendMessage("Done");
trace("Same thread:" + (me==Thread.current()) );
} );
var result = Thread.readMessage(true);
trace(result);
for(x in 0...20)
{
trace("call...");
createNativeThread();
trace("zzz...");
Sys.sleep(1);
var result = Thread.readMessage(true);
trace(result);
}
}
}

View File

@ -0,0 +1,16 @@
#include <hx/Native.h>
#include <hx/Thread.h>
THREAD_FUNC_TYPE threadFunc(void *data)
{
printf("In thread\n");
hx::NativeAttach attach;
Test_obj::callFromThread();
THREAD_FUNC_RET
}
void runThread()
{
HxCreateDetachedThread(threadFunc,nullptr);
}

View File

@ -0,0 +1 @@
hello

View File

@ -0,0 +1,4 @@
-main Test
-cpp cpp
-debug
-cp ../unit