Commit 216200af authored by Arthur O'Dwyer's avatar Arthur O'Dwyer
Browse files

[libc++] Fix hang in counting_semaphore::try_acquire

Before this patch, `try_acquire` blocks instead of returning false.
This is because `__libcpp_thread_poll_with_backoff` interprets zero
as meaning infinite, causing `try_acquire` to wait indefinitely.

Thanks to Pablo Busse (pabusse) for the patch!

Differential Revision: https://reviews.llvm.org/D98334

(cherry picked from commit c92a253c)
parent 00f64ccb
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment