MCPcopy Create free account
hub / github.com/RedisGears/RedisGears / GetPythonThreadCtx

Function GetPythonThreadCtx

plugins/python/redisgears_python.c:1131–1148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1129}
1130
1131static PythonThreadCtx* GetPythonThreadCtx(){
1132 PythonThreadCtx* ptctx = pthread_getspecific(pythonThreadCtxKey);
1133 if(!ptctx){
1134 ptctx = RG_ALLOC(sizeof(*ptctx));
1135 *ptctx = (PythonThreadCtx){
1136 .lockCounter = 0,
1137 .currentCtx = NULL,
1138 .createdExecution = NULL,
1139 .doneFunction = onDone,
1140 .flags = 0,
1141 .crtCtx = NULL,
1142 .commandCtx = NULL,
1143 .pyfutureCreated = NULL,
1144 };
1145 pthread_setspecific(pythonThreadCtxKey, ptctx);
1146 }
1147 return ptctx;
1148}
1149
1150bool RedisGearsPy_IsLockAcquired(){
1151 PythonThreadCtx* ptctx = GetPythonThreadCtx();

Callers 15

RedisGearsPy_LockFunction · 0.85
RedisGearsPy_UnlockFunction · 0.85
runFunction · 0.85
registerExecutionFunction · 0.85
atomicEnterFunction · 0.85
atomicExitFunction · 0.85
gearsFutureCtxFunction · 0.85
registerGearsThreadFunction · 0.85
getGearsSessionFunction · 0.85
isInAtomicBlockFunction · 0.85
setGearsSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected