[fpc-pascal] writeln in threads on linux
Ole J. Røtne
ole.rotne at online.no
Sun Jul 2 11:52:29 CEST 2006
Can anyone explain why i get output like this in a small test program:
Inside Thread
Main Loop
Inside Thread
Main Loop
Inside Thread
Main Loop
On Windows the output are lined up just as I would expect:
Inside Thread
Main Loop
Inside Thread
Main Loop
Here's a snip of the code:
// Main Prog
Thr := threadtest.Create;
Repeat
k := PollKeyEvent;
WriteLn('Mein Loop');
Sleep(100);
Until k <> 0;
And the ThreadTest.Execute i just:
Procedure ThreadTest.Execute;
Begin
Repeat
WriteLn('Inside Thread');
Sleep(100);
Until Terminated
End;
And if this is a "wrong way" of doing this thing, could someone tell me how
it should be..
Oh and BTW. Using FPC 2.1.1 snapshot from 14.06.06 (from Lazarus site), on
OpenSuSe 10.1..
More information about the fpc-pascal
mailing list