Ok, next step on the "try and error" way.
Code:
uses SDL;
var
thread: PSDL_Thread;
returnValue: Integer;
function thread_func(): Integer;
begin
// do threading here
WriteLn('Start Thread');
SDL_Delay(5000);
WriteLn('End Thread');
result := 1; // thread leaves and return this value
end;
begin
returnValue := 0;
thread := SDL_CreateThread(@thread_func, NIL);
SDL_WaitThread(thread, returnValue);
WriteLn('Thread returns code ',returnValue);
SDL_Quit;
WriteLn('ByeBye ;)');
end.
Crashed too, there is something wrong with thread management.
Thomas
Bookmarks