summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrinivas%netscape.com <devnull@localhost>1999-12-24 01:05:42 +0000
committersrinivas%netscape.com <devnull@localhost>1999-12-24 01:05:42 +0000
commit3481d6af56191bb7dde466555ad0ea040140adb9 (patch)
tree51a34c0854b5b7be86daa3210320d284087d08d7
parent0472baeb69e5090400c9ea68bc343ac6451a0501 (diff)
downloadnspr-hg-3481d6af56191bb7dde466555ad0ea040140adb9.tar.gz
Minimize spurious notifications when interrupts are blocked.
Bugzilla #17055.
-rw-r--r--pr/src/pthreads/ptthread.c2
-rw-r--r--pr/src/threads/prcthr.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/pr/src/pthreads/ptthread.c b/pr/src/pthreads/ptthread.c
index d2760f82..49f08da1 100644
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -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);
diff --git a/pr/src/threads/prcthr.c b/pr/src/threads/prcthr.c
index 5a4fa502..bd3a1b49 100644
--- a/pr/src/threads/prcthr.c
+++ b/pr/src/threads/prcthr.c
@@ -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