diff options
| author | Eric Fiselier <eric@efcs.ca> | 2017-05-05 21:31:22 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2017-05-05 21:31:22 +0000 |
| commit | 0be6d5ba92589312c79dc6c8115698864454c3d1 (patch) | |
| tree | b43bf903c01912a28b9fb4b4dcfa6a6573a32d50 /libcxx/include/__threading_support | |
| parent | c8e377c326e91fec5f333f58b63376b4481b64e6 (diff) | |
| download | bcm5719-llvm-0be6d5ba92589312c79dc6c8115698864454c3d1.tar.gz bcm5719-llvm-0be6d5ba92589312c79dc6c8115698864454c3d1.zip | |
Fix condition_variable::wait_until and wait_for on Windows.
The ERROR_TIMEDOUT returned by the Windows API does not
have the same value as ETIMEDOUT. This caused condition_variable
to return timeouts as unknown errors.
llvm-svn: 302297
Diffstat (limited to 'libcxx/include/__threading_support')
| -rw-r--r-- | libcxx/include/__threading_support | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support index aa947139a4e..080ebd256b8 100644 --- a/libcxx/include/__threading_support +++ b/libcxx/include/__threading_support @@ -474,7 +474,10 @@ int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m, timeout_ms.count() > 0 ? timeout_ms.count() : 0, 0)) - return GetLastError(); + { + auto __ec = GetLastError(); + return __ec == ERROR_TIMEOUT ? ETIMEDOUT : __ec; + } return 0; } |

