diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-30 00:32:23 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-30 00:32:23 +0000 |
commit | fc3bcfb0f54e199dd5629dd6428f06d42bd83549 (patch) | |
tree | f8f0f1de32452b1adf4d58ebdbacab90b48876bf /base/message_pump_win.cc | |
parent | 9bcbf478c173d91958cdabc8a8902619392b7f1f (diff) | |
download | chromium_src-fc3bcfb0f54e199dd5629dd6428f06d42bd83549.zip chromium_src-fc3bcfb0f54e199dd5629dd6428f06d42bd83549.tar.gz chromium_src-fc3bcfb0f54e199dd5629dd6428f06d42bd83549.tar.bz2 |
A better fix for the hang observed while running net_unittests on vista. This
fix avoids a crash as well by not calling ProcessPumpReplacementMessage.
Instead, we just reset the have_work_ flag.
TBR=rvargas,jar
BUG=1351146
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_win.cc')
-rw-r--r-- | base/message_pump_win.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/base/message_pump_win.cc b/base/message_pump_win.cc index 7b053c3..b67c00e 100644 --- a/base/message_pump_win.cc +++ b/base/message_pump_win.cc @@ -203,18 +203,20 @@ void MessagePumpWin::InitMessageWnd() { } void MessagePumpWin::HandleWorkMessage() { + // If we are being called outside of the context of Run, then don't try to do + // any work. This could correspond to a MessageBox call or something of that + // sort. + if (!state_) { + // Since we handled a kMsgHaveWork message, we must still update this flag. + InterlockedExchange(&have_work_, 0); + return; + } + // Let whatever would have run had we not been putting messages in the queue // run now. This is an attempt to make our dummy message not starve other - // messages that may be in the Windows message queue. We also need to call - // this in order to ensure that have_work_ gets reset to 0. + // messages that may be in the Windows message queue. ProcessPumpReplacementMessage(); - // If we are being called outside of the context of Run, then don't do - // anything. This could correspond to a MessageBox call or something of - // that sort. - if (!state_) - return; - // Now give the delegate a chance to do some work. He'll let us know if he // needs to do more work. if (state_->delegate->DoWork()) |