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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302297 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -474,7 +474,10 @@ int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,
|
|||||||
timeout_ms.count() > 0 ? timeout_ms.count()
|
timeout_ms.count() > 0 ? timeout_ms.count()
|
||||||
: 0,
|
: 0,
|
||||||
0))
|
0))
|
||||||
return GetLastError();
|
{
|
||||||
|
auto __ec = GetLastError();
|
||||||
|
return __ec == ERROR_TIMEOUT ? ETIMEDOUT : __ec;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user