[fpc-pascal] Question: Is there a global callback, when a thread gets terminated?

Martin Frb lazarus at mfriebe.de
Fri Feb 8 14:45:29 CET 2019


On 07/02/2019 16:03, George Bakhtadze wrote:
> As an option, you can store all thread-specific data within a 
> thread-safe data structure (Map) instead of threadvars and free that 
> structure in unit's finalization.
Yes, but you can end up with a lot of data for dead threads, if an app 
create many short lived threads.

> 07.02.2019, 15:17, "Martin Frb" <lazarus at mfriebe.de>:
>>
>> As for the question, why create an object, why not just "threadvar
>> indent". User code can create (within the same thread) more than one
>> instance of the logger.
>> This I something that can be used in testcase, where the testcase wants
>> to have a logger, but does not want to mix with the log of the tested
>> code (maybe capture that log).
>>
>




More information about the fpc-pascal mailing list