From 6ee72b6f0a536fc7c150fe6d54a0af5d7995b04f Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 14 Nov 2014 00:08:30 +0100 Subject: [PATCH] Use concurrency::wait on Windows to sleep. The chrono + sleep_for implementation seems not to work, due to bugs in chrono header file. And after all sleep_for calculates a time_point for sleep_until, which calculates the delta again and finally passes the number of milliseconds to concurrency::wait ... --- v8js.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/v8js.cc b/v8js.cc index abd0c96..0df8d2d 100644 --- a/v8js.cc +++ b/v8js.cc @@ -1120,8 +1120,12 @@ static void php_v8js_timer_thread(TSRMLS_D) } // Sleep for 10ms +#ifdef _WIN32 + concurrency::wait(10); +#else std::chrono::milliseconds duration(10); std::this_thread::sleep_for(duration); +#endif } }