Boost logo

Boost :

From: Bronek Kozicki (brok_at_[hidden])
Date: 2003-12-12 13:58:29


JOLY Loic <loic.joly_at_[hidden]> wrote:
> If we modify the code to have it all in the main program, it works as
> intended, but here, when the trhead is launched from the DLL, creating
> the thread object hangs.
[...]

> BOOL WINAPI DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID
> lpReserved)
> {
> if(ul_reason_for_call == DLL_PROCESS_ATTACH)
> {
> DrDT drdt;

Here you created DrDT object , and looking at its constructor I can see

> DrDT()
> {
> std::cout << "Hello World from DrDT." << std::endl;
> thrd = new boost::thread(boost::bind(&DrDT::run, this));

that you are starting new thread in here. Threads may not be started
while executing DllMain; such thread is suspend. This is how
mutlithreading works in Windows. I guess that threads library is
somewhere waiting for this thread to get started?

B.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk