Re: [fpc-pascal] Current TThread

2010-12-21 Thread Helmut Hartl
Am 21.12.10 13:47, schrieb Mattias Gaertner: On Tue, 21 Dec 2010 14:29:36 +0100 (CET) michael.vancann...@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

Re: [fpc-pascal] Current TThread

2010-12-21 Thread Jonas Maebe
On 21 Dec 2010, at 14:59, michael.vancann...@wisa.be wrote: On Tue, 21 Dec 2010, Mattias Gaertner wrote: What about using a threadvar CurrentThread: Thread; ? TThread could set this in the constructor. This could be done, but will give errors for externally created threads. And for th

Re: [fpc-pascal] Current TThread

2010-12-21 Thread michael . vancanneyt
On Tue, 21 Dec 2010, Mattias Gaertner wrote: On Tue, 21 Dec 2010 14:29:36 +0100 (CET) michael.vancann...@wisa.be wrote: On Tue, 21 Dec 2010, Mattias Gaertner wrote: Hi, How to get the current TThread instance? There is no documented method. Strange. Am I really the first needing thi

Re: [fpc-pascal] Current TThread

2010-12-21 Thread Mattias Gaertner
On Tue, 21 Dec 2010 14:29:36 +0100 (CET) michael.vancann...@wisa.be wrote: > > > On Tue, 21 Dec 2010, Mattias Gaertner wrote: > > > Hi, > > > > How to get the current TThread instance? > > There is no documented method. Strange. Am I really the first needing this? > > For example: I created

Re: [fpc-pascal] Current TThread

2010-12-21 Thread michael . vancanneyt
On Tue, 21 Dec 2010, Mattias Gaertner wrote: Hi, How to get the current TThread instance? There is no documented method. For example: I created a TThread and called a function, which calls a function One of those sub functions needs to call TThread.Synchronize, which needs as parame

[fpc-pascal] Current TThread

2010-12-21 Thread Mattias Gaertner
Hi, How to get the current TThread instance? For example: I created a TThread and called a function, which calls a function One of those sub functions needs to call TThread.Synchronize, which needs as parameter the current TThread. Mattias ___ fp