Re: debugging multithreaded app
From: Tim Robinson (tim.at.gaat.freeserve.co.uk_at_nowhere.com)
Date: 03/16/05
- Next message: whocares: "Re: Release build seg faults at vector.push_back above certain siz"
- Previous message: Larry Brasfield: "Re: Release build seg faults at vector.push_back above certain siz"
- In reply to: Bruno van Dooren: "debugging multithreaded app"
- Next in thread: Bruno van Dooren: "Re: debugging multithreaded app"
- Reply: Bruno van Dooren: "Re: debugging multithreaded app"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Mar 2005 21:38:45 -0000
"Bruno van Dooren" <microvax@hotmail.com> wrote in message
news:eW6ZXylKFHA.1176@TK2MSFTNGP15.phx.gbl...
> i was debugging a multithreaded app, when i stumbled across some weird
> behavior of the debugger.
>
> in the destructor of my main object i send a stop event to the worker
> thread, and then wait until that thread has finished.
>
> m_Stop = true;
> while(GetExitCodeThread() == STILL_RUNNING)
> Sleep(50);
[...]
I can't claim any insight into your problem, but this is the traditional way
to wait for a thread to exit:
m_Stop = true;
WaitForSingleObject(m_ThreadHandle, INFINITE);
There's no need to poll, as the original code does.
-- Tim Robinson MVP, Windows SDK
- Next message: whocares: "Re: Release build seg faults at vector.push_back above certain siz"
- Previous message: Larry Brasfield: "Re: Release build seg faults at vector.push_back above certain siz"
- In reply to: Bruno van Dooren: "debugging multithreaded app"
- Next in thread: Bruno van Dooren: "Re: debugging multithreaded app"
- Reply: Bruno van Dooren: "Re: debugging multithreaded app"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|