You are not logged in.
Pages: 1
sorry for the offtopic,
hello,
I'm using the very powerful TTASK api of System.Threading,
however I need a thing:
the pool is dynamic, I attach a TLS class with DB components into the running thread of the context, and keeping it in memory until the thread runs (avoiding create and destroy every time a db context).
I need to have an event OnAThreadExit of the System.TThreadPool so I can free the TLS class when the thread is made free.
How can be done without change the source of System.Threading.pas? Winapi doesn't offer a callback on thread exit, only a poll api is found, so cannot be used (I need to call TLS code within the thread, before the exit).
thank you
R.
Offline
Why are you asking this question here?
It depends on the Delphi RTL, not on mORMot.
You should better ask on stack overflow, I'm sure.
For the mORMot background process classes, there is are built-in events when the threads start or stop.
Offline
Pages: 1