summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/miscfuncs.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-11-15 04:35:13 +0000
committerChristopher Faylor <me@cgf.cx>2002-11-15 04:35:13 +0000
commit6597785dc2a719262309d251ac57251848a320be (patch)
tree20c0fcb5df7e1e1c09a06b31780d11965581e270 /winsup/cygwin/miscfuncs.cc
parentd4990113a1fc4df05af7ec5ff63a0951432d4eb2 (diff)
downloadcygnal-6597785dc2a719262309d251ac57251848a320be.tar.gz
cygnal-6597785dc2a719262309d251ac57251848a320be.tar.bz2
cygnal-6597785dc2a719262309d251ac57251848a320be.zip
* 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/miscfuncs.cc')
-rw-r--r--winsup/cygwin/miscfuncs.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 36a3d9332..9c7ab5434 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -1,6 +1,6 @@
/* miscfuncs.cc: misc funcs that don't belong anywhere else
- Copyright 1996, 1997, 1998, 1999, 2000 Red Hat, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
This file is part of Cygwin.
@@ -295,8 +295,9 @@ sys_mbstowcs (WCHAR *tgt, const char *src, int len)
void __stdcall
low_priority_sleep (DWORD secs)
{
- DWORD prio = GetThreadPriority (GetCurrentThread ());
- SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE);
+ HANDLE thisthread = GetCurrentThread ();
+ int curr_prio = GetThreadPriority (thisthread);
+ SetThreadPriority (thisthread, THREAD_PRIORITY_IDLE);
Sleep (secs);
- SetThreadPriority (GetCurrentThread (), prio);
+ SetThreadPriority (thisthread, curr_prio);
}