Don't send messages from or to a thread in cleanup. Fixes possible deadlock.

svn path=/trunk/; revision=51469
This commit is contained in:
Timo Kreuzer 2011-04-27 23:49:09 +00:00
parent b39193c83d
commit de078e7357

View file

@ -818,6 +818,13 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
ASSERT(ThreadQueue != MessageQueue); ASSERT(ThreadQueue != MessageQueue);
ASSERT(ptirec->pcti); // Send must have a client side to receive it!!!! ASSERT(ptirec->pcti); // Send must have a client side to receive it!!!!
/* Don't send from or to a dying thread */
if (pti->TIF_flags & TIF_INCLEANUP || ptirec->TIF_flags & TIF_INCLEANUP)
{
*uResult = -1;
return STATUS_TIMEOUT;
}
Timeout.QuadPart = (LONGLONG) uTimeout * (LONGLONG) -10000; Timeout.QuadPart = (LONGLONG) uTimeout * (LONGLONG) -10000;
/* FIXME - increase reference counter of sender's message queue here */ /* FIXME - increase reference counter of sender's message queue here */