diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-02-18 19:28:43 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-02-18 19:28:43 +0000 |
| commit | b455a8331cb3231406160c782b07c4ac3b78f638 (patch) | |
| tree | 4cb61b24bd6b09dcb5389b19a2caf29fa7d508ee /libcxx/include/__threading_support | |
| parent | c409aa8a9e58f95548b9fb3bdb4a4be47bf605d7 (diff) | |
| download | bcm5719-llvm-b455a8331cb3231406160c782b07c4ac3b78f638.tar.gz bcm5719-llvm-b455a8331cb3231406160c782b07c4ac3b78f638.zip | |
Revert "threading_support: make __thread_sleep_for be alertable"
This reverts SVN r295329. Although `__libcpp_thread_sleep_for` should
be alertable, the implementation causes a large regression in the test
suite. Add a FIXME item there for now to get the test suite in a better
state before attempting to fix that behaviour.
llvm-svn: 295561
Diffstat (limited to 'libcxx/include/__threading_support')
| -rw-r--r-- | libcxx/include/__threading_support | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support index 8b0b2eda9b0..aa947139a4e 100644 --- a/libcxx/include/__threading_support +++ b/libcxx/include/__threading_support @@ -589,14 +589,12 @@ void __libcpp_thread_yield() void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns) { - using namespace _VSTD::chrono; - + using namespace chrono; // round-up to the nearest milisecond milliseconds __ms = duration_cast<milliseconds>(__ns + chrono::nanoseconds(999999)); - auto start = system_clock::now(); - while (::SleepEx((__ms - (system_clock::now() - start)).count(), - TRUE) == WAIT_IO_COMPLETION); + // FIXME(compnerd) this should be an alertable sleep (WFSO or SleepEx) + Sleep(__ms.count()); } // Thread Local Storage |

