diff options
author | Christopher Faylor <me@cgf.cx> | 2003-08-28 02:04:16 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-08-28 02:04:16 +0000 |
commit | e2bc5017fa996b7de73821db61b14c2d552bfc06 (patch) | |
tree | 77813fcbca6d7f05cffeed9fb13637574c089408 /winsup/cygwin/miscfuncs.cc | |
parent | cc9f0cf0af2d2ef2beb508c8438ed938b775628f (diff) | |
download | cygnal-e2bc5017fa996b7de73821db61b14c2d552bfc06.tar.gz cygnal-e2bc5017fa996b7de73821db61b14c2d552bfc06.tar.bz2 cygnal-e2bc5017fa996b7de73821db61b14c2d552bfc06.zip |
* syscalls.cc (mount): Don't check win32_path when doing cygdrive mount.
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r-- | winsup/cygwin/miscfuncs.cc | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index fea1b1249..d9e4a7adb 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -8,6 +8,7 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ +#define _WIN32_WINNT 0x400 #include "winsup.h" #include "cygerrno.h" #include <sys/errno.h> @@ -16,6 +17,7 @@ details. */ #include <limits.h> #include <winbase.h> #include <winnls.h> +#include "cygthread.h" long tls_ix = -1; @@ -306,13 +308,27 @@ low_priority_sleep (DWORD secs) staylow = true; } - int main_prio = GetThreadPriority (hMainThread); - if (curr_prio != main_prio) - /* Force any threads in normal priority to be scheduled */ - SetThreadPriority (thisthread, main_prio); - Sleep (secs); + if (!secs && wincap.has_switch_to_thread ()) + { + for (int i = 0; i < 10; i++) + SwitchToThread (); + } + else + { + int new_prio; + if (GetCurrentThreadId () == cygthread::main_thread_id) + new_prio = THREAD_PRIORITY_LOWEST; + else + new_prio = GetThreadPriority (hMainThread); + + if (curr_prio != new_prio) + /* Force any threads in normal priority to be scheduled */ + SetThreadPriority (thisthread, new_prio); + Sleep (secs); + + if (!staylow || curr_prio == new_prio) + SetThreadPriority (thisthread, curr_prio); + } - if (!staylow || curr_prio == main_prio) - SetThreadPriority (thisthread, curr_prio); return curr_prio; } |