diff options
author | Christopher Faylor <me@cgf.cx> | 2003-01-10 03:13:45 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-01-10 03:13:45 +0000 |
commit | d5223b2b0a89ff9ee3f5eabf713724ef2452092e (patch) | |
tree | bc09a0f213aff6d1139ac8c6a6c2e61a9b7e7036 /winsup/cygwin/miscfuncs.cc | |
parent | 65f207e8b906dad44844227fdb7cdcf397496552 (diff) | |
download | cygnal-d5223b2b0a89ff9ee3f5eabf713724ef2452092e.tar.gz cygnal-d5223b2b0a89ff9ee3f5eabf713724ef2452092e.tar.bz2 cygnal-d5223b2b0a89ff9ee3f5eabf713724ef2452092e.zip |
* cygthread.cc (cygthread::cygthread): Be more noisy about odd condition.
* miscfuncs.cc (low_priority_sleep): Sleep in regular priority if that's what
we're currently running at.
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r-- | winsup/cygwin/miscfuncs.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index e58565942..a47625cf9 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -306,13 +306,12 @@ low_priority_sleep (DWORD secs) staylow = true; } - /* Force any threads in normal priority to be scheduled */ - SetThreadPriority (thisthread, THREAD_PRIORITY_NORMAL); - Sleep (0); - - SetThreadPriority (thisthread, THREAD_PRIORITY_IDLE); + if (curr_prio != THREAD_PRIORITY_NORMAL) + /* Force any threads in normal priority to be scheduled */ + SetThreadPriority (thisthread, THREAD_PRIORITY_NORMAL); Sleep (secs); - if (!staylow) + + if (!staylow || curr_prio == THREAD_PRIORITY_NORMAL) SetThreadPriority (thisthread, curr_prio); return curr_prio; } |