[fpc-pascal] Current TThread

Helmut Hartl helmut.hartl at firmos.at
Tue Dec 21 22:22:38 CET 2010


Am 21.12.10 13:47, schrieb Mattias Gaertner:
> On Tue, 21 Dec 2010 14:29:36 +0100 (CET)
> michael.vancanneyt at wisa.be wrote:
>
>> You could use GetCurrentThreadID and a lookup list.
> What about using a
>
> threadvar CurrentThread: Thread;
>
> ?
> TThread could set this in the constructor.
>
We currently use this method for our "in Application" scheduler, but IIRC
you have to fetch/set the ID in the Execute method.
But having the overhead of using threadvars (mentionent on the list some
time ago) I am currently looking for another method too.

helmut





More information about the fpc-pascal mailing list