名稱空間
變體
操作

標準庫標頭檔案 <rcu> (C++26)

來自 cppreference.com
 
 
標準庫標頭檔案
演算法
<algorithm>
<numeric>
字串
<cctype>
<cstring>
<cuchar> (C++11)
<cwchar>
<cwctype>
<string_view> (C++17)
<string>
文字處理
<clocale>
<codecvt> (C++11/17/26*)
<locale>
<regex> (C++11)
<text_encoding> (C++26)   
數值
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<simd> (C++26)
<valarray>
時間
<chrono> (C++11)
<ctime>
C 相容性
<ccomplex> (C++11/17/20*)
<ciso646> (直到 C++20)
<cstdalign> (C++11/17/20*)
<cstdbool> (C++11/17/20*)
<ctgmath> (C++11/17/20*)
 

此標頭檔案是 執行緒支援 庫的一部分。

目錄

允許物件受 RCU 保護
(類模板) [編輯]
提供 RCU 保護區域
(類) [編輯]

函式

返回對型別為 std::rcu_domain 的靜態持續期物件的引用
(函式) [編輯]
阻塞直到 RCU 域上的保護區域解鎖
(函式) [編輯]
可能會評估 RCU 域上計劃的操作,並阻塞直到所有先前的評估完成
(函式) [編輯]
在 RCU 域上安排指定函式的評估,可能分配記憶體,並呼叫計劃的評估
(函式模板) [編輯]

[編輯] 概要

namespace std {
  template<class T, class D = default_delete<T>> class rcu_obj_base;
 
  class rcu_domain;
 
  rcu_domain& rcu_default_domain() noexcept;
  void rcu_synchronize(rcu_domain& dom = rcu_default_domain()) noexcept;
  void rcu_barrier(rcu_domain& dom = rcu_default_domain()) noexcept;
  template<class T, class D = default_delete<T>>
    void rcu_retire(T* p, D d = D(), rcu_domain& dom = rcu_default_domain());
}

[編輯] 類模板 std::rcu_obj_base

namespace std {
  template<class T, class D = default_delete<T>>
  class rcu_obj_base {
  public:
    void retire(D d = D(), rcu_domain& dom = rcu_default_domain()) noexcept;
  protected:
    rcu_obj_base() = default;
    rcu_obj_base(const rcu_obj_base&) = default;
    rcu_obj_base(rcu_obj_base&&) = default;
    rcu_obj_base& operator=(const rcu_obj_base&) = default;
    rcu_obj_base& operator=(rcu_obj_base&&) = default;
    ~rcu_obj_base() = default;
  private:
    D deleter;            // exposition only
  };
}

[編輯] std::rcu_domain

namespace std {
  class rcu_domain {
  public:
    rcu_domain(const rcu_domain&) = delete;
    rcu_domain& operator=(const rcu_domain&) = delete;
 
    void lock() noexcept;
    bool try_lock() noexcept;
    void unlock() noexcept;
  };
}