I'm looking for a CLR event (or hook) that allows running .NET code on that
same thread before it terminates. This hook should work for both "new
Thread()" and also threads from thread pools.
The code must run on the thread itself (and not on the Finalizer thread).
Such low level hook exists in native code (DllMain), however that code runs
under the OS loader lock which causes deadlocks.
Any pointers and ideas would be appreciated.
Regards,
Itai