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

Function atomicExit

plugins/python/redisgears_python.c:2137–2152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2135}
2136
2137static PyObject* atomicExit(PyObject *self, PyObject *args){
2138 PythonThreadCtx* ptctx = GetPythonThreadCtx();
2139 if(!(ptctx->flags & PythonThreadCtxFlag_InsideAtomic)){
2140 PyErr_SetString(GearsError, "Not inside an atomic block");
2141 return NULL;
2142 }
2143 ptctx->flags &= ~PythonThreadCtxFlag_InsideAtomic;
2144 PyAtomic* pyAtomic = (PyAtomic*)self;
2145 if (redisVersion->redisMajorVersion < 7) {
2146 /* see comment on atomicEnter */
2147 RedisModule_Replicate(pyAtomic->ctx, "exec", "");
2148 }
2149 RedisGears_LockHanlderRelease(pyAtomic->ctx);
2150 Py_INCREF(Py_None);
2151 return Py_None;
2152}
2153
2154// LCOV_EXCL_START
2155

Callers

nothing calls this directly

Calls 1

GetPythonThreadCtxFunction · 0.85

Tested by

no test coverage detected