Added an assert and return so that eventQs only get

processed on the owning thread.  This fixes at least
18005 and 17065.  r=damn@netscape.com, a=chofmann.


git-svn-id: svn://10.0.0.236/trunk@55941 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%netscape.com
1999-12-13 23:05:31 +00:00
parent f55b31ca34
commit 8efe8bcc68

View File

@@ -190,6 +190,10 @@ nsEventQueueImpl::IsQueueOnCurrentThread(PRBool *aResult)
NS_IMETHODIMP
nsEventQueueImpl::ProcessPendingEvents()
{
PRBool correctThread = PL_IsQueueOnCurrentThread(mEventQueue);
NS_ASSERTION(correctThread, "attemping to process events on the wrong thread");
if (!correctThread)
return NS_ERROR_FAILURE;
PL_ProcessPendingEvents(mEventQueue);
CheckForDeactivation();
return NS_OK;
@@ -198,6 +202,11 @@ nsEventQueueImpl::ProcessPendingEvents()
NS_IMETHODIMP
nsEventQueueImpl::EventLoop()
{
PRBool correctThread = PL_IsQueueOnCurrentThread(mEventQueue);
NS_ASSERTION(correctThread, "attemping to process events on the wrong thread");
if (!correctThread)
return NS_ERROR_FAILURE;
PL_EventLoop(mEventQueue);
return NS_OK;
}
@@ -220,6 +229,11 @@ nsEventQueueImpl::GetEvent(PLEvent** aResult)
NS_IMETHODIMP
nsEventQueueImpl::HandleEvent(PLEvent* aEvent)
{
PRBool correctThread = PL_IsQueueOnCurrentThread(mEventQueue);
NS_ASSERTION(correctThread, "attemping to process events on the wrong thread");
if (!correctThread)
return NS_ERROR_FAILURE;
PL_HandleEvent(aEvent);
return NS_OK;
}
@@ -227,6 +241,11 @@ nsEventQueueImpl::HandleEvent(PLEvent* aEvent)
NS_IMETHODIMP
nsEventQueueImpl::WaitForEvent()
{
PRBool correctThread = PL_IsQueueOnCurrentThread(mEventQueue);
NS_ASSERTION(correctThread, "attemping to process events on the wrong thread");
if (!correctThread)
return NS_ERROR_FAILURE;
PL_WaitForEvent(mEventQueue);
CheckForDeactivation();
return NS_OK;