12 #ifndef ROC_CORE_SEQLOCK_IMPL_H_
13 #define ROC_CORE_SEQLOCK_IMPL_H_
29 return (ver & 1) == 0;
46 const void* new_value);
52 const void* new_value);
56 const void* current_value,
58 void* return_value)
const;
62 const void* current_value,
64 void* return_value)
const;
68 const void* current_value,
70 void* return_value)
const;
Seqlock implementation class.
bool try_store(seqlock_version_t &ver, void *current_value, size_t value_size, const void *new_value)
Try to store value.
void exclusive_store(seqlock_version_t &ver, void *current_value, size_t value_size, const void *new_value)
Store value.
bool try_load_repeat(seqlock_version_t &ver, const void *current_value, size_t value_size, void *return_value) const
Try to load value and version.
void wait_load(seqlock_version_t &ver, const void *current_value, size_t value_size, void *return_value) const
Load value and version.
seqlock_version_t version() const
Load value version.
bool seqlock_version_is_valid(seqlock_version_t ver)
Check if this is a valid seqlock version. Returns false if seqlock version corresponds to intermediat...
uint32_t seqlock_version_t
Type for holding seqlock value version. Version is changed each value update. May wrap.
Commonly used types and functions.