Hello all.

In it's current form (r23227) CurrentThreadVar it's not initialized before calling Execute in the TThread implementation for Linux (Unix).

Due to this the calls to TThread.CurrentThread always returns references to TExternalThread instances, guessing that the current thread is not a FPC thread (due to CurrentThreadVar being nil), even for actual TThread threads.

Adding the line:

        CurrentThreadVar := LThread;

somewhere before calling Execute in ThreadFunc in rtl/unix/tthread.inc
solves this problem.

Also: the TExternalThread instances created by TThread.CurrentThread are never freed, and so effectively leaked, isn't it?

Thanks,
Mario

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to