| 1129 | } |
| 1130 | |
| 1131 | static 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 | |
| 1150 | bool RedisGearsPy_IsLockAcquired(){ |
| 1151 | PythonThreadCtx* ptctx = GetPythonThreadCtx(); |
no outgoing calls
no test coverage detected