[all-commits] [llvm/llvm-project] 216200: [libc++] Fix hang in counting_semaphore::try_acquire
Quuxplusone via All-commits
all-commits at lists.llvm.org
Fri Nov 5 13:03:52 PDT 2021
Branch: refs/heads/release/13.x
Home: https://github.com/llvm/llvm-project
Commit: 216200aff2681407b5e799738b09a047771d86ec
https://github.com/llvm/llvm-project/commit/216200aff2681407b5e799738b09a047771d86ec
Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
Date: 2021-11-05 (Fri, 05 Nov 2021)
Changed paths:
M libcxx/include/semaphore
M libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp
Log Message:
-----------
[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 c92a253cf0ddcf905707b4e9265b42570ce409d9)
More information about the All-commits
mailing list