[libcxx-commits] [libcxx] [libc++] Impelement P2545R4 Read-Copy Update (RCU) (PR #175451)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 23 11:21:20 PST 2026


================
@@ -0,0 +1,284 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___RCU_RCU_DOMAIN_H
+#define _LIBCPP___RCU_RCU_DOMAIN_H
+
+#include <__config>
+
+#include <__atomic/atomic.h>
+#include <__rcu/rcu_list.h>
+
+// todo replace with internal headers
+#include <atomic>
+#include <cstdint>
+#include <map>
+#include <mutex>
+#include <vector>
+
+// todo debug
+#include <cstdio>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_THREADS && _LIBCPP_HAS_EXPERIMENTAL_RCU
+
+template <class _ThreadLocal>
----------------
ldionne wrote:

```suggestion
template <class _Tp>
```

Or `_Value` .This makes it clearer IMO that this is some kind of "generic container".

https://github.com/llvm/llvm-project/pull/175451


More information about the libcxx-commits mailing list