static void BSslLockingCB(int iMode, int iType, const char *pszFile, int iLine) { if (pSslMtxs != NULL) { if (iMode & CRYPTO_LOCK) SysLockMutex(pSslMtxs[iType], SYS_INFINITE_TIMEOUT); else SysUnlockMutex(pSslMtxs[iType]); } }
int RLckCleanupLockers(void) { if (SysLockMutex(hRLMutex, SYS_INFINITE_TIMEOUT) < 0) return ErrGetErrorCode(); for (int i = 0; i < STD_WAIT_GATES; i++) { for (int j = 0; j < RLGates[i].iHashSize; j++) { SysListHead *pHead = &RLGates[i].pResList[j]; SysListHead *pLLink; while ((pLLink = SYS_LIST_FIRST(pHead)) != NULL) { ResLockEntry *pRLE = SYS_LIST_ENTRY(pLLink, ResLockEntry, LLink); SYS_LIST_DEL(&pRLE->LLink); RLckFreeEntry(pRLE); } } SysFree(RLGates[i].pResList); SysCloseSemaphore(RLGates[i].hSemaphore); } SysUnlockMutex(hRLMutex); SysCloseMutex(hRLMutex); return 0; }