[libcxx-commits] [libcxx] [libc++] atomic timed wait (PR #172214)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Dec 14 07:13:38 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions ,h,cpp -- libcxx/include/__atomic/atomic_sync_timed.h libcxx/include/__atomic/atomic_waitable_traits.h libcxx/include/__atomic/atomic.h libcxx/include/__atomic/atomic_flag.h libcxx/include/__atomic/atomic_ref.h libcxx/include/__atomic/atomic_sync.h libcxx/include/__thread/poll_with_backoff.h libcxx/include/__thread/timed_backoff_policy.h libcxx/include/atomic libcxx/include/semaphore libcxx/src/atomic.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__atomic/atomic_sync_timed.h b/libcxx/include/__atomic/atomic_sync_timed.h
index ca7502b64..a13672ed3 100644
--- a/libcxx/include/__atomic/atomic_sync_timed.h
+++ b/libcxx/include/__atomic/atomic_sync_timed.h
@@ -38,7 +38,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
# if _LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_NEW_SYNC
_LIBCPP_AVAILABILITY_NEW_SYNC
- _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __atomic_monitor_global(void const* __address) _NOEXCEPT;
+_LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __atomic_monitor_global(void const* __address) _NOEXCEPT;
// wait on the global contention state to be changed from the given value for the address
_LIBCPP_AVAILABILITY_NEW_SYNC _LIBCPP_EXPORTED_FROM_ABI void __atomic_wait_global_table_with_timeout(
diff --git a/libcxx/include/semaphore b/libcxx/include/semaphore
index f93f8243b..aa9fa6fb2 100644
--- a/libcxx/include/semaphore
+++ b/libcxx/include/semaphore
@@ -109,9 +109,8 @@ public:
if (__rel_time == chrono::duration<_Rep, _Period>::zero())
return try_acquire();
- return std::__atomic_wait_unless_with_timeout(__a_, memory_order_relaxed, [this](ptrdiff_t& __old) {
- return __try_acquire_impl(__old);
- }, __rel_time);
+ return std::__atomic_wait_unless_with_timeout(
+ __a_, memory_order_relaxed, [this](ptrdiff_t& __old) { return __try_acquire_impl(__old); }, __rel_time);
}
_LIBCPP_HIDE_FROM_ABI bool try_acquire() {
auto __old = __a_.load(memory_order_relaxed);
``````````
</details>
https://github.com/llvm/llvm-project/pull/172214
More information about the libcxx-commits
mailing list