> To do that it has to set up some flags, set an event that allows the sleeping > com worker thread to run, then wait for another event that's signalled by > that thread when it's done. All that's too much for the consequences of what > I assume is a simple FreeLibrary call in your shutdown code.
The freelibrary does not happen until after the unload service returns. I am not clear on what you mean by "event when thread is done". Do you have another event that thread signals? Or is the main event just waiting for the worker thread to exit (I cannot remember if this is possible). If the first, maybe what is happening is - main thread sets event - worker thread finishes and sets another event but it is still running - main thread returns and freelibrary is called while worker thread is still running Does that sound like it? > The alternative is to leave things as they are, and require users to always > call com.unload in PProShutdown list. > The alternative of always calling com.unload sounds easiest for users to me. >
