Minimize spurious notifications when interrupts are blocked.

Bugzilla #17055.
This commit is contained in:
srinivas%netscape.com 1999-12-24 01:05:42 +00:00
Родитель 783fd83ec9
Коммит 3425cb3cbb
2 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -657,7 +657,7 @@ PR_IMPLEMENT(PRStatus) PR_Interrupt(PRThread *thred)
thred->state |= PT_THREAD_ABORTED;
cv = thred->waiting;
if (NULL != cv)
if ((NULL != cv) && !thred->interrupt_blocked)
{
PRIntn rv = pthread_cond_broadcast(&cv->cv);
PR_ASSERT(0 == rv);

Просмотреть файл

@ -171,7 +171,7 @@ PR_IMPLEMENT(PRStatus) PR_Interrupt(PRThread *thread)
thread->flags |= _PR_INTERRUPT;
victim = thread->wait.cvar;
_PR_THREAD_UNLOCK(thread);
if (NULL != victim) {
if ((NULL != victim) && !thread->interrupt_blocked) {
int haveLock = (victim->lock->owner == _PR_MD_CURRENT_THREAD());
if (!haveLock) PR_Lock(victim->lock);
@ -194,7 +194,8 @@ PR_IMPLEMENT(PRStatus) PR_Interrupt(PRThread *thread)
* call is made with thread locked;
* on return lock is released
*/
_PR_NotifyLockedThread(thread);
if (!thread->interrupt_blocked)
_PR_NotifyLockedThread(thread);
break;
case _PR_IO_WAIT:
/*
@ -203,7 +204,8 @@ PR_IMPLEMENT(PRStatus) PR_Interrupt(PRThread *thread)
* released.
*/
#if defined(XP_UNIX) || defined(WINNT) || defined(WIN16)
_PR_Unblock_IO_Wait(thread);
if (!thread->interrupt_blocked)
_PR_Unblock_IO_Wait(thread);
#else
_PR_THREAD_UNLOCK(thread);
#endif