diff --git a/include/__threading_support b/include/__threading_support index aa947139a..080ebd256 100644 --- a/include/__threading_support +++ b/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; }