52#define PFS_LOCK_FREE 0x00
60#define PFS_LOCK_DIRTY 0x01
67#define PFS_LOCK_ALLOCATED 0x02
69#define VERSION_MASK 0xFFFFFFFC
70#define STATE_MASK 0x00000003
339 return (
copy->m_version_state == version_state);
Some integer typedefs for easier portability.
uint32_t uint32
Definition: my_inttypes.h:67
void copy(Shards< COUNT > &dst, const Shards< COUNT > &src) noexcept
Copy the counters, overwrite destination.
Definition: ut0counter.h:354
Definition: pfs_lock.h:77
uint32 m_version_state
Definition: pfs_lock.h:78
A 'lock' protecting performance schema internal buffers.
Definition: pfs_lock.h:154
void allocated_to_free()
Execute an allocated to free transition.
Definition: pfs_lock.h:300
bool is_populated()
Returns true if the record contains values that can be read.
Definition: pfs_lock.h:189
void dirty_to_allocated(const pfs_dirty_state *copy)
Execute a dirty to allocated transition.
Definition: pfs_lock.h:243
uint32 copy_version_state()
Definition: pfs_lock.h:173
bool end_optimistic_lock(const pfs_optimistic_state *copy)
End an optimistic read operation.
Definition: pfs_lock.h:330
void allocated_to_dirty(pfs_dirty_state *copy_ptr)
Execute an allocated to dirty transition.
Definition: pfs_lock.h:225
bool is_free()
Returns true if the record is free.
Definition: pfs_lock.h:182
void begin_optimistic_lock(pfs_optimistic_state *copy)
Start an optimistic read operation.
Definition: pfs_lock.h:320
void dirty_to_free(const pfs_dirty_state *copy)
Execute a dirty to free transition.
Definition: pfs_lock.h:286
uint32 get_version()
Definition: pfs_lock.h:342
std::atomic< uint32 > m_version_state
The record internal version and state.
Definition: pfs_lock.h:171
void set_dirty(pfs_dirty_state *copy_ptr)
Initialize a lock to dirty.
Definition: pfs_lock.h:272
void set_allocated()
Initialize a lock to allocated.
Definition: pfs_lock.h:259
bool free_to_dirty(pfs_dirty_state *copy_ptr)
Execute a free to dirty transition.
Definition: pfs_lock.h:201
Definition: pfs_lock.h:73
uint32 m_version_state
Definition: pfs_lock.h:74