Author: ericwf Date: Fri May 5 16:31:22 2017 New Revision: 302297 URL: http://llvm.org/viewvc/llvm-project?rev=302297&view=rev Log: 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. Modified: libcxx/trunk/include/__threading_support Modified: libcxx/trunk/include/__threading_support URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__threading_support?rev=302297&r1=302296&r2=302297&view=diff ============================================================================== --- libcxx/trunk/include/__threading_support (original) +++ libcxx/trunk/include/__threading_support Fri May 5 16:31:22 2017 @@ -474,7 +474,10 @@ int __libcpp_condvar_timedwait(__libcpp_ timeout_ms.count() > 0 ? timeout_ms.count() : 0, 0)) - return GetLastError(); + { + auto __ec = GetLastError(); + return __ec == ERROR_TIMEOUT ? ETIMEDOUT : __ec; + } return 0; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits