8#define SSD_LOCK_DEBUG 1
11typedef struct SSDTree SSDTree;
12typedef struct SSDNode SSDNode;
13typedef SSDNode *(*SSDNodeFactory)(SSDTree *info);
35typedef struct SSDLockDebug {
42typedef struct SSDLockState
45 bool _is_SSDLockState;
55enum SSD_LOCK_STATE_ENUM {
56 _ssdCurrentLockState = 0
61SSDLockState *__ssdLockStateInit(_Out_ SSDLockState *lstate, _In_z_
const char *fn,
int lnum);
62#define _ssdLockStateInit(lstate) __ssdLockStateInit(lstate, __FILE__, __LINE__)
64SSDLockState *_ssdLockStateInit(_Out_ SSDLockState *lstate);
98#define ssdLockRead(root) _ssdLockRead(SSDNode(root), (SSDLockState*)&_ssdCurrentLockState->_is_SSDLockState, __FILE__, __LINE__)
99#define _ssdManualLockRead(root, lstate) _ssdLockRead(SSDNode(root), lstate, __FILE__, __LINE__)
100bool _ssdLockRead(_Inout_ SSDNode *root, _Inout_ SSDLockState *lstate, _In_z_
const char *fn,
int lnum);
102#define ssdLockRead(root) _ssdLockRead(SSDNode(root), _ssdCurrentLockState)
103#define _ssdManualLockRead(root, lstate) _ssdLockRead(SSDNode(root), lstate)
104bool _ssdLockRead(_Inout_ SSDNode *root, _Inout_ SSDLockState *lstate);
128#define ssdLockWrite(root) _ssdLockWrite(SSDNode(root), (SSDLockState*)&_ssdCurrentLockState->_is_SSDLockState, __FILE__, __LINE__)
129#define _ssdManualLockWrite(root, lstate) _ssdLockWrite(SSDNode(root), lstate, __FILE__, __LINE__)
130bool _ssdLockWrite(_Inout_ SSDNode *root, _Inout_ SSDLockState *lstate, _In_z_
const char *fn,
int lnum);
132#define ssdLockWrite(root) _ssdLockWrite(SSDNode(root), _ssdCurrentLockState)
133#define _ssdManualLockWrite(root, lstate) _ssdLockWrite(SSDNode(root), lstate)
134bool _ssdLockWrite(_Inout_ SSDNode *root, _Inout_ SSDLockState *lstate);
147#define ssdUnlock(root) _ssdUnlock(SSDNode(root), (SSDLockState*)&_ssdCurrentLockState->_is_SSDLockState)
148bool _ssdUnlock(_Inout_ SSDNode *root, _Inout_ SSDLockState *lstate);
159#define ssdLockEnd(root) _ssdLockEnd(SSDNode(root), (SSDLockState*)&_ssdCurrentLockState->_is_SSDLockState)
160bool _ssdLockEnd(_Inout_ SSDNode *root, _Inout_ SSDLockState *lstate);
186#define ssdLockedTransaction(root) _blkStart \
188 _blkFull(SSDLockState _ssdTransientLockState = { 0 }, (root), \
189 _ssdLockEnd(SSDNode(root), &_ssdTransientLockState)) \
190 _blkBefore(SSDLockState *_ssdCurrentLockStateShadow = (SSDLockState*)_ssdCurrentLockState) \
191 _blkBefore(SSDLockState *_ssdCurrentLockState = _ssdCurrentLockStateShadow ? \
192 _ssdCurrentLockStateShadow : _ssdLockStateInit(&_ssdTransientLockState)) \
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.