MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Graph_ReleaseLock

Function Graph_ReleaseLock

src/graph/graph.c:72–87  ·  view source on GitHub ↗

Release the held lock

Source from the content-addressed store, hash-verified

70
71// Release the held lock
72void Graph_ReleaseLock
73(
74 Graph *g
75) {
76 ASSERT(g != NULL);
77
78 // set _writelocked to false BEFORE unlocking
79 // if this is a reader thread no harm done,
80 // if this is a writer thread the writer is about to unlock so once again
81 // no harm done, if we set `_writelocked` to false after unlocking it is possible
82 // for a reader thread to be considered as writer, performing illegal access to
83 // underline matrices, consider a context switch after unlocking `_rwlock` but
84 // before setting `_writelocked` to false
85 g->_writelocked = false;
86 pthread_rwlock_unlock(&g->_rwlock);
87}
88
89//------------------------------------------------------------------------------
90// Graph utility functions

Callers 15

RG_AfterForkParentFunction · 0.85
_QueryCtx_UnlockCommitFunction · 0.85
_ExecuteQueryFunction · 0.85
Graph_ExplainFunction · 0.85
_Constraint_DropFunction · 0.85
_Constraint_CreateFunction · 0.85
RdbSaveGraph_v13Function · 0.85
Effects_ApplyFunction · 0.85
Constraint_EnforceNodesFunction · 0.85
Constraint_EnforceEdgesFunction · 0.85
BulkInsertFunction · 0.85
_indexer_idx_populateFunction · 0.85

Calls

no outgoing calls

Tested by 9

_build_graphFunction · 0.68
test_newGraphFunction · 0.68
test_graphConstructionFunction · 0.68
test_removeNodesFunction · 0.68
test_getNodeFunction · 0.68
test_getEdgeFunction · 0.68