Yeah, the loader lock is held the entire time while in the DLL main. The
lock allows re-entrance, but if you do anything that starts another thread
and then tries to dynamically load a DLL you'll get a deadlock.
Unfortunately, it's very hard to predict what will cause a dynamic load (or
one of
That OleInitialize/Uninitialize business is there to prevent
unbalanced Ole init calls in some cases.
I did not realize DllMain was called with the loader lock held. Looks
like it could cause deadlocks.
I'll make move that code to a separate function invoked before the DLL
is unloaded .
Jay
On
Ah, that sounds great. Thanks!-Darin
On Mon, Sep 28, 2009 at 11:30 PM, Jay Campan jcam...@chromium.org wrote:
That OleInitialize/Uninitialize business is there to prevent
unbalanced Ole init calls in some cases.
I did not realize DllMain was called with the loader lock held. Looks
like it
I've read somewhere before that you should do as little as possible inside
DllMain. Something like this comes to mind:
http://blogs.msdn.com/oldnewthing/archive/2007/09/04/4731478.aspx
Is it worth trying to defer calling OleInitialize?