|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
#include <safe_hazard_pointer.h>

Public Member Functions | |
| safe_hazard_guard (void *p=nullptr, size_t slot=0) | |
| Construct guard, optionally protecting a pointer. | |
| ~safe_hazard_guard () | |
| Destructor - releases the record. | |
| safe_hazard_guard (const safe_hazard_guard &)=delete | |
| safe_hazard_guard & | operator= (const safe_hazard_guard &)=delete |
| safe_hazard_guard (safe_hazard_guard &&other) noexcept | |
| safe_hazard_guard & | operator= (safe_hazard_guard &&other) noexcept |
| void | protect (void *p) noexcept |
| Protect a pointer. | |
| void | clear () noexcept |
| Clear protection. | |
| void * | get () const noexcept |
| Get protected pointer. | |
| operator bool () const noexcept | |
| Check if valid. | |
Private Attributes | |
| safe_hazard_pointer_record * | record_ |
| size_t | slot_ |
Definition at line 360 of file safe_hazard_pointer.h.
|
inlineexplicit |
Construct guard, optionally protecting a pointer.
| p | Pointer to protect (optional) |
| slot | Slot index (0 or 1) |
Definition at line 367 of file safe_hazard_pointer.h.
References kcenon::thread::safe_hazard_pointer_record::protect(), record_, and slot_.

|
inline |
Destructor - releases the record.
Definition at line 378 of file safe_hazard_pointer.h.
References kcenon::thread::safe_hazard_pointer_domain::instance(), record_, and kcenon::thread::safe_hazard_pointer_domain::release().

|
delete |
|
inlinenoexcept |
Definition at line 389 of file safe_hazard_pointer.h.
|
inlinenoexcept |
Clear protection.
Definition at line 420 of file safe_hazard_pointer.h.
References kcenon::thread::safe_hazard_pointer_record::clear(), record_, and slot_.

|
inlinenodiscardnoexcept |
Get protected pointer.
Definition at line 429 of file safe_hazard_pointer.h.
References kcenon::thread::safe_hazard_pointer_record::get(), record_, and slot_.

|
inlineexplicitnodiscardnoexcept |
|
delete |
|
inlinenoexcept |
Definition at line 395 of file safe_hazard_pointer.h.
References kcenon::thread::safe_hazard_pointer_domain::instance(), record_, kcenon::thread::safe_hazard_pointer_domain::release(), and slot_.

|
inlinenoexcept |
Protect a pointer.
| p | Pointer to protect |
Definition at line 411 of file safe_hazard_pointer.h.
References kcenon::thread::safe_hazard_pointer_record::protect(), record_, and slot_.
Referenced by kcenon::thread::detail::lockfree_job_queue::dequeue(), kcenon::thread::detail::lockfree_job_queue::empty(), and kcenon::thread::detail::lockfree_job_queue::enqueue().


|
private |
Definition at line 441 of file safe_hazard_pointer.h.
Referenced by clear(), get(), operator bool(), operator=(), protect(), safe_hazard_guard(), and ~safe_hazard_guard().
|
private |
Definition at line 442 of file safe_hazard_pointer.h.
Referenced by clear(), get(), operator=(), protect(), and safe_hazard_guard().