Click here to Skip to main content
15,886,799 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 4:40
professional Randor 16-Sep-09 4:40 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Roger Stoltz16-Sep-09 5:34
Roger Stoltz16-Sep-09 5:34 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 7:04
professional Randor 16-Sep-09 7:04 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Chesnokov Yuriy16-Sep-09 7:22
professionalChesnokov Yuriy16-Sep-09 7:22 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 7:47
professional Randor 16-Sep-09 7:47 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Roger Stoltz16-Sep-09 7:59
Roger Stoltz16-Sep-09 7:59 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 8:51
professional Randor 16-Sep-09 8:51 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Roger Stoltz16-Sep-09 11:58
Roger Stoltz16-Sep-09 11:58 
Okay David, now I know what you mean and of course you're right.

I am aware if the scenario you're describing, or perhaps I should put it as "I have been"... Unsure | :~
I've used the technique I described earlier (CWinThread::m_bAutoDelete blah blah) for a rather long time (must be almost a decade D'Oh! | :doh: ) which saves me from a lot of troubles, including this one. I just forgot one of the reasons why I always use this technique and had a hard time putting it together in this context. Shucks | :-\


Randor wrote:
I'm surprised that you have not read about this before.


Well, I take that as a compliment. Blush | :O
But in my defence I have to mention that until your last post I interpreted your statement as the handle provided to the waiting function indeed was a valid handle to the worker thread, but it got recycled during the time one thread was waiting on the handle and that caused the waiting function to hang. That's what made me "seriously doubt it" since it would make the whole synchronization mechanism unreliable.
So it turns out I misunderstood you, to my relief.

I'm grateful for the reminder David, thanks.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Randor 16-Sep-09 12:25
professional Randor 16-Sep-09 12:25 
GeneralRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Roger Stoltz16-Sep-09 12:51
Roger Stoltz16-Sep-09 12:51 
AnswerRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Stuart Dootson16-Sep-09 1:58
professionalStuart Dootson16-Sep-09 1:58 
AnswerRe: WaitForSingleObject(m_SomeThread->m_hThread, INFINITE); Pin
Jeff Archer16-Sep-09 2:47
Jeff Archer16-Sep-09 2:47 
QuestionExiting an MFC ActiveX Pin
Opa Knack15-Sep-09 22:41
Opa Knack15-Sep-09 22:41 
AnswerRe: Exiting an MFC ActiveX Pin
Stuart Dootson16-Sep-09 0:28
professionalStuart Dootson16-Sep-09 0:28 
AnswerRe: Exiting an MFC ActiveX Pin
Roger Stoltz16-Sep-09 0:38
Roger Stoltz16-Sep-09 0:38 
AnswerRe: Exiting an MFC ActiveX Pin
Randor 16-Sep-09 1:13
professional Randor 16-Sep-09 1:13 
QuestionAuto login a user in XP, after logoff Pin
SummerBulb15-Sep-09 21:59
SummerBulb15-Sep-09 21:59 
AnswerRe: Auto login a user in XP, after logoff Pin
«_Superman_»15-Sep-09 22:27
professional«_Superman_»15-Sep-09 22:27 
GeneralRe: Auto login a user in XP, after logoff Pin
SummerBulb15-Sep-09 22:32
SummerBulb15-Sep-09 22:32 
GeneralRe: Auto login a user in XP, after logoff Pin
SummerBulb15-Sep-09 22:45
SummerBulb15-Sep-09 22:45 
QuestionDifference between C++ and VC++ Pin
hrishiS15-Sep-09 21:09
hrishiS15-Sep-09 21:09 
AnswerRe: Difference between C++ and VC++ Pin
CPallini15-Sep-09 21:19
mveCPallini15-Sep-09 21:19 
AnswerRe: Difference between C++ and VC++ Pin
QuickDeveloper15-Sep-09 21:32
QuickDeveloper15-Sep-09 21:32 
GeneralRe: Difference between C++ and VC++ Pin
CPallini15-Sep-09 22:00
mveCPallini15-Sep-09 22:00 
GeneralRe: Difference between C++ and VC++ Pin
hrishiS16-Sep-09 1:04
hrishiS16-Sep-09 1:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.