sechshelme / Lazarus-SDL3.0-Packages_and_Examples

2 stars 0 forks source link

Thread example needs cthreads unit on Linux #3

Open rchastain opened 4 months ago

rchastain commented 4 months ago

The thread example needs cthreads unit on Linux:

uses
{$IFDEF linux}
  cthreads,
{$ENDIF}

Otherwise I get a runtime error:

Simple SDL_CreateThread test:
Runtime error 202 at $000000000041745C
  $000000000041745C
  $00007F509D4F8DA4
  $00007F509D677BF5
  $00007F509D1D59CA

Tested on Linux Mageia 64-bit.

sechshelme commented 4 months ago

I took a closer look and I think the cthread is certainly not bad, even though it seems to work without it for me.

But I noticed another problem. If only one thread is running, it's fine, but if several are running in parallel, it's a WriteLn gift. This must definitely be replaced by SDL_Log, otherwise it will crash.

I have adapted my thread examples.

sechshelme commented 3 months ago

I tried it with win64. 05_-_Thread2 brings a SIGSEV 05-_Thread_1 works. Do you have any idea ?