[libc++] Fixes a flaky test.
While investigating the flaky tests on the mac backdeployment targets it seems the tests are different than suggested in the LWG issue. That tests "does work", grabs the mutex, marks the task as done, and finally calls the notifier. Our test emulated "does work" after the notification, effectively sleeping with a lock held. This has been fixed. A second improvement is that the test fails when, due to OS scheduling, the condition variable is not used in the main thread. During discussing the approach of the patch with @ldionne, he noticed the real reason why the test is flaky; the Apple backdeployment targets use a dylib, which does not contain the fix. So the test can't be tested on that platform; it only proves the LWG issue was correct and the Standard contained a bug. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D143816
Loading
Please sign in to comment