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

Function PythonSessionCtx_Unlink

plugins/python/redisgears_python.c:703–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

701}
702
703static void PythonSessionCtx_Unlink(PythonSessionCtx* session){
704 /* Unlink requirements if we are the only owner */
705 for(size_t i = 0 ; i < array_len(session->requirements) ; ++i){
706 PythonRequirementCtx* req = session->requirements[i];
707 if (req->refCount == 2) {
708 /* We are the only owner together with the requiremnets dictionary */
709 Gears_dictDelete(RequirementsDict, req->installName);
710 req->isInRequirementsDict = false;
711 PythonRequirementCtx_Free(req);
712 }
713 }
714 pthread_mutex_lock(&PySessionsLock);
715 PythonSessionCtx_Del(session);
716 Gears_listAddNodeTail(DeadSessionsList, session);
717 session->deadNode = Gears_listLast(DeadSessionsList);
718 pthread_mutex_unlock(&PySessionsLock);
719}
720
721static void PythonSessionCtx_Free(PythonSessionCtx* session){
722 pthread_mutex_lock(&PySessionsLock);

Callers 2

Python_UnlinkSessionFunction · 0.85

Calls 5

array_lenFunction · 0.85
Gears_dictDeleteFunction · 0.85
PythonSessionCtx_DelFunction · 0.85
Gears_listAddNodeTailFunction · 0.85

Tested by

no test coverage detected