From c0a02a4b42accbc574e84654cd845f8971d6a298 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 13 Nov 2002 19:36:12 +0000 Subject: * miscfuncs.cc (low_priority_sleep): New function. Use throughout where code is supposed to be giving up time slice. * fhandler_console.cc (fhandler_console::read): Switch button 2/3 output escape sequences to be consistent with xterm. --- winsup/cygwin/miscfuncs.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'winsup/cygwin/miscfuncs.cc') diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index fd7ae8edf..36a3d9332 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -291,3 +291,12 @@ sys_mbstowcs (WCHAR *tgt, const char *src, int len) { return MultiByteToWideChar (get_cp (), 0, src, -1, tgt, len); } + +void __stdcall +low_priority_sleep (DWORD secs) +{ + DWORD prio = GetThreadPriority (GetCurrentThread ()); + SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE); + Sleep (secs); + SetThreadPriority (GetCurrentThread (), prio); +} -- cgit v1.2.3