0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-23 00:51:51 +00:00

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 ...
This commit is contained in:
Stefan Siegl 2014-11-14 00:08:30 +01:00
parent 449d66ca01
commit 6ee72b6f0a

View File

@ -1120,8 +1120,12 @@ static void php_v8js_timer_thread(TSRMLS_D)
} }
// Sleep for 10ms // Sleep for 10ms
#ifdef _WIN32
concurrency::wait(10);
#else
std::chrono::milliseconds duration(10); std::chrono::milliseconds duration(10);
std::this_thread::sleep_for(duration); std::this_thread::sleep_for(duration);
#endif
} }
} }