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:
authorCorinna Vinschen <corinna@vinschen.de>2019-02-26 12:46:05 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-02-26 12:46:05 +0300
commit639645a2fd753f29ed9693b7c34f015c01de1741 (patch)
treec821f8f541c14a012f1235197f545e59c25e2ee2
parent5a483b6bcac263102df890c3172ecddf23fc9f53 (diff)
Cygwin: timerfd: add a sleep when being debugged
A sleep is required on Windows 10 64 bit only before calling RegisterClassW in the timerfd thread, and only when running under strace. One of the child processes inheriting the timerfd descriptor will get a STATUS_FLOAT_INEXACT_RESULT exception inside of msvcrt.dll. It's apparently some timing problem. It occurs in 4 out of 5 runs under strace only. WOW64 and Windows 7 64 bit don't have this problem. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/timerfd.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/timerfd.cc b/winsup/cygwin/timerfd.cc
index b0d4db9de..8e4c94e66 100644
--- a/winsup/cygwin/timerfd.cc
+++ b/winsup/cygwin/timerfd.cc
@@ -32,6 +32,15 @@ timerfd_tracker::create_timechange_window ()
wclass.lpfnWndProc = DefWindowProcW;
wclass.hInstance = user_data->hmodule;
wclass.lpszClassName = cname;
+ /* This sleep is required on Windows 10 64 bit only, and only when running
+ under strace. One of the child processes inheriting the timerfd
+ descriptor will get a STATUS_FLOAT_INEXACT_RESULT exception inside of
+ msvcrt.dll. While this is completely crazy in itself, it's apparently
+ some timing problem. It occurs in 4 out of 5 runs under strace only.
+ The sleep is required before calling RegisterClassW. Moving it before
+ CreateWindowExW does not work. What the heck? */
+ if (being_debugged ())
+ Sleep (1L);
atom = RegisterClassW (&wclass);
if (!atom)
debug_printf ("RegisterClass %E");