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>2003-08-28 06:04:16 +0400
committerChristopher Faylor <me@cgf.cx>2003-08-28 06:04:16 +0400
commite2bc5017fa996b7de73821db61b14c2d552bfc06 (patch)
tree77813fcbca6d7f05cffeed9fb13637574c089408 /winsup/cygwin/miscfuncs.cc
parentcc9f0cf0af2d2ef2beb508c8438ed938b775628f (diff)
* 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.cc30
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;
}