Re: WaitForSingleObject() will not deadlock
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 23:05:58 -0400
You can't, it is impossible; it violates the fundamental design of a mutex!!!!
Note that if you block the GUI thread, it blocks the GUI thread, and you can never dismiss
the dialog!
You are creating a complex solution to a trivial problem! See my earlier answer!
joe
On Sat, 30 Jun 2007 00:31:03 -0700, Frank Cusack <fcusack@xxxxxxxxxxx> wrote:
Code like thisJoseph M. Newcomer [MVP]
if (WaitForSingleObject(mutex, INFINITE) == WAIT_OBJECT_0)
AfxMessageBox("acquired", ID_OK);
if (WaitForSingleObject(mutex, INFINITE) == WAIT_OBJECT_0)
AfxMessageBox("acquired", ID_OK);
displays 2 alert boxes. How do I make this deadlock instead?
-frank
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: WaitForSingleObject() will not deadlock
- From: Frank Cusack
- Re: WaitForSingleObject() will not deadlock
- Prev by Date: Re: create window before calling CDialog::DoModal()?
- Next by Date: Re: WaitForSingleObject() will not deadlock
- Previous by thread: Re: WaitForSingleObject() will not deadlock
- Next by thread: Re: WaitForSingleObject() will not deadlock
- Index(es):
Relevant Pages
|