From 02e1abfaad51220c97ceea0dc7cf36b0778dc676 Mon Sep 17 00:00:00 2001 From: Jim Mathies Date: Tue, 9 Feb 2010 22:47:44 -0600 Subject: [PATCH] Bug 538918 - follow up patch: IsMessagePending should use PeekMessage, not the stacks for detection. --HG-- extra : transplant_source : %3D%E4_%CE7m%FE%8F%B0S%DC%9F%FAF%D7%40%5D%83%C1/ --- ipc/glue/WindowsMessageLoop.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/ipc/glue/WindowsMessageLoop.cpp b/ipc/glue/WindowsMessageLoop.cpp index d97458d08192..66e977fb206c 100644 --- a/ipc/glue/WindowsMessageLoop.cpp +++ b/ipc/glue/WindowsMessageLoop.cpp @@ -595,20 +595,11 @@ RPCChannel::SpinInternalEventLoop() bool RPCChannel::IsMessagePending() { - MutexAutoLock lock(mMutex); - if (mStack.empty()) + MSG msg = { 0 }; + if (PeekMessageW(&msg, (HWND)-1, gEventLoopMessage, gEventLoopMessage, + PM_REMOVE)) { return true; - - MessageMap::iterator it = mOutOfTurnReplies.find(mStack.top().seqno()); - if (!mOutOfTurnReplies.empty() && - it != mOutOfTurnReplies.end() && - it->first == mStack.top().seqno()) - return true; - - if (!mPending.empty() && - mPending.front().seqno() == mStack.top().seqno()) - return true; - + } return false; }