18#ifndef __R_HZR_PTR_H__
19#define __R_HZR_PTR_H__
21#if !defined(__RLIB_H_INCLUDE_GUARD__) && !defined(RLIB_COMPILATION)
22#error "#include <rlib.h> only please."
60#define R_HZR_PTR_INIT(notify) { 0, (RDestroyNotify)notify }
rpointer r_hzr_ptr_acquire(rhzrptr *hzrptr, RHzrPtrRec *rec)
Publish a hazard for the current value of hzrptr and return it.
RHzrPtrRec * r_hzr_ptr_rec_new(void)
Allocate a per-thread hazard record.
void r_hzr_ptr_release(rhzrptr *hzrptr, RHzrPtrRec *rec)
Drop the hazard published by a previous r_hzr_ptr_acquire.
struct RHzrPtrRec RHzrPtrRec
Opaque per-thread hazard record.
Definition rhzrptr.h:74
void r_hzr_ptr_replace(rhzrptr *hzrptr, rpointer ptr)
Atomically replace hzrptr's value with ptr and schedule the displaced value for delayed reclamation.
void r_hzr_ptr_rec_free(RHzrPtrRec *rec)
Free a per-thread hazard record at thread exit.
#define R_API
Public-API decoration: resolves to R_API_EXPORT while building rlib and R_API_IMPORT for consumers.
Definition rmacros.h:115
#define R_BEGIN_DECLS
Open an extern "C" block under C++ (no-op in C).
Definition rmacros.h:196
void(* RDestroyNotify)(rpointer ptr)
Destructor callback: free / release the value at ptr.
Definition rtypes.h:401
void * rpointer
Generic pointer (alias for void *).
Definition rtypes.h:327
Atomic load / store / exchange / CAS / fetch-modify operations on integer, unsigned-integer and point...
Foundational type aliases used by every rlib header.
Pointer slot that participates in hazard-pointer reclamation.
Definition rhzrptr.h:69
RDestroyNotify notify
Definition rhzrptr.h:71
raptr ptr
Definition rhzrptr.h:70