Mladen Turk wrote:
> Hi,
>
> pthreads have option to register destruct callback
> for private thread keys created.
> Here is the patch that allow that for WIN32 but
> only when compiled as dll.
>
> Any comments or objections?
> The consequence is that the DllMain is added, and
> I suppose its not possible to have that functionality
> with static apr lib.
> OTOH it allows to have the same behavior like with
> pthreads actually calling provided callback to
> the apr_threadkey_private_create instead just ignoring
> it.

I've recently learned of a trick that would make this work anywhere,
even in a static lib, and wouldn't need DllMain. You can actually insert
your own constructors and destructors into the CRT's tables.

-- Brane

Reply via email to