8#define SSD_LOCK_DEBUG 1
13typedef struct SSDTree SSDTree;
14typedef struct SSDNode SSDNode;
15typedef SSDNode* (*SSDNodeFactory)(SSDTree* info);
37typedef struct SSDLockDebug {
44typedef struct SSDLockState {
46 bool _is_SSDLockState;
56enum SSD_LOCK_STATE_ENUM { _ssdCurrentLockState = 0 };
60SSDLockState* __ssdLockStateInit(_Out_ SSDLockState* lstate, _In_z_
const char* fn,
int lnum);
61#define _ssdLockStateInit(lstate) __ssdLockStateInit(lstate, __FILE__, __LINE__)
63SSDLockState* _ssdLockStateInit(_Out_ SSDLockState* lstate);
97#define ssdLockRead(root) \
98 _ssdLockRead(SSDNode(root), \
99 (SSDLockState*)&_ssdCurrentLockState->_is_SSDLockState, \
102#define _ssdManualLockRead(root, lstate) _ssdLockRead(SSDNode(root), lstate, __FILE__, __LINE__)
103bool _ssdLockRead(_Inout_ SSDNode* root, _Inout_ SSDLockState* lstate, _In_z_
const char* fn,
106#define ssdLockRead(root) _ssdLockRead(SSDNode(root), _ssdCurrentLockState)
107#define _ssdManualLockRead(root, lstate) _ssdLockRead(SSDNode(root), lstate)
108bool _ssdLockRead(_Inout_ SSDNode* root, _Inout_ SSDLockState* lstate);
132#define ssdLockWrite(root) \
133 _ssdLockWrite(SSDNode(root), \
134 (SSDLockState*)&_ssdCurrentLockState->_is_SSDLockState, \
137#define _ssdManualLockWrite(root, lstate) _ssdLockWrite(SSDNode(root), lstate, __FILE__, __LINE__)
138bool _ssdLockWrite(_Inout_ SSDNode* root, _Inout_ SSDLockState* lstate, _In_z_
const char* fn,
141#define ssdLockWrite(root) _ssdLockWrite(SSDNode(root), _ssdCurrentLockState)
142#define _ssdManualLockWrite(root, lstate) _ssdLockWrite(SSDNode(root), lstate)
143bool _ssdLockWrite(_Inout_ SSDNode* root, _Inout_ SSDLockState* lstate);
156#define ssdUnlock(root) \
157 _ssdUnlock(SSDNode(root), (SSDLockState*)&_ssdCurrentLockState->_is_SSDLockState)
158bool _ssdUnlock(_Inout_ SSDNode* root, _Inout_ SSDLockState* lstate);
169#define ssdLockEnd(root) \
170 _ssdLockEnd(SSDNode(root), (SSDLockState*)&_ssdCurrentLockState->_is_SSDLockState)
171bool _ssdLockEnd(_Inout_ SSDNode* root, _Inout_ SSDLockState* lstate);
197#define ssdLockedTransaction(root) \
198 _blkStart _inhibitReturn _blkFull(SSDLockState _ssdTransientLockState = { 0 }, \
200 _ssdLockEnd(SSDNode(root), &_ssdTransientLockState)) \
201 _blkBefore(SSDLockState* _ssdCurrentLockStateShadow = (SSDLockState*)_ssdCurrentLockState) \
202 _blkBefore(SSDLockState* _ssdCurrentLockState = _ssdCurrentLockStateShadow ? \
203 _ssdCurrentLockStateShadow : \
204 _ssdLockStateInit(&_ssdTransientLockState)) _blkEnd
Block wrapping macros for automatic resource management.
enum SSD_CREATE_TYPE_ENUM SSDCreateType
Node creation types for specifying which kind of node to create.
SSD_CREATE_TYPE_ENUM
Node creation types for specifying which kind of node to create.
SSD_FLAGS_ENUM
Flags for configuring SSD tree behavior.
@ SSD_Create_Single
Create a single-value node.
@ SSD_Create_Array
Create an array (indexed) node.
@ SSD_Create_Hashtable
Create a hashtable (key-value) node.
@ SSD_Create_None
Do not create a node.
@ SSD_Create_Count
Total number of creation types (internal use)
@ SSD_CaseInsensitive
Keys in hashtables are case-insensitive.
Reader-writer lock synchronization primitive.
Dynamic arrays with type-safe generic programming.