Daniel points out
that there is still a race condition here, so this trick won't work. Rats.
The documentation for the
This prevents a deadlock from occurring when one thread in
DllMain is waiting for the callback to end,
and another thread that is executing the callback