Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-11-15 07:35:13 +0300
committerChristopher Faylor <me@cgf.cx>2002-11-15 07:35:13 +0300
commit6597785dc2a719262309d251ac57251848a320be (patch)
tree20c0fcb5df7e1e1c09a06b31780d11965581e270 /winsup/cygwin/exceptions.cc
parentd4990113a1fc4df05af7ec5ff63a0951432d4eb2 (diff)
* exceptions.cc (setup_handler): Add debugging output. Set thread priority to
idle if pending signals to allow other threads to get into interruptible state. * miscfuncs.cc (sys_mbstowcs): Save current thread in variable to avoid an OS call. * wait.cc (wait_sig): Reset thread priority each time through loop since the priority may have been set down to deal with pending signals.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 05f285b2e..ae868cc7c 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -637,7 +637,7 @@ interruptible (DWORD pc, int testvalid = 0)
# define h ((HMODULE) m.AllocationBase)
/* Apparently Windows 95 can sometimes return bogus addresses from
- GetThreadContext. These resolve to an allocation base == 0.
+ GetThreadContext. These resolve to a strange allocation base.
These should *never* be treated as interruptible. */
if (!h || m.State != MEM_COMMIT)
res = 0;
@@ -866,7 +866,13 @@ setup_handler (int sig, void *handler, struct sigaction& siga)
LeaveCriticalSection (&th->lock);
}
else if (interruptible (cx.Eip))
- interrupted = interrupt_now (&cx, sig, handler, siga);
+ {
+ interrupted = interrupt_now (&cx, sig, handler, siga);
+#ifdef DEBUGGING
+ if (!interrupted)
+ sigproc_printf ("couldn't deliver signal %d via %p", sig, cx.Eip);
+#endif
+ }
else
break;
}
@@ -892,6 +898,8 @@ setup_handler (int sig, void *handler, struct sigaction& siga)
}
sigproc_printf ("returning %d", interrupted);
+ if (pending_signals)
+ SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE);
return interrupted;
}
#endif /* i386 */