mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-23 04:51:53 +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:
parent
449d66ca01
commit
6ee72b6f0a
4
v8js.cc
4
v8js.cc
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user