void mntlist_delete_all(char *host) { HASHSET_ITERATOR iterator; struct mntentry *m; (void) rw_wrlock(&rmtab_lock); iterator = h_iterator(mntlist); while (m = (struct mntentry *)h_next(iterator)) { if (strcasecmp(m->m_host, host)) continue; rmtab_delete(m->m_pos); (void) h_delete(mntlist, m); free(m->m_path); free(m->m_host); free(m); } if (RMTAB_TOOMANY_DELETED()) rmtab_rewrite(); (void) rw_unlock(&rmtab_lock); if (iterator != NULL) free(iterator); }
LIBPROTO(CleanupAmiSSLA, LONG, REG(a6, UNUSED __BASE_OR_IFACE), REG(a0, UNUSED struct TagItem *tagList)) { AMISSL_STATE *state; SHOWREGISTERS(); if((state = GetAmiSSLState())) { #ifdef __amigaos4__ if(state->SocketBase && state->ISocketPtr && *state->ISocketPtr) { DropInterface((struct Interface *)*state->ISocketPtr); state->ISocketPtr = NULL; } #endif ObtainSemaphore(&parentBase->openssl_cs); D(DBF_STARTUP, "h_delete(parentBase->thread_hash)"); h_delete(parentBase->thread_hash, state->pid); ReleaseSemaphore(&parentBase->openssl_cs); FreeVec(state); } return(0); }
static void ThreadGroupStateCleanup(UNUSED long Key, AMISSL_STATE *a) { if(a->ThreadGroupID == ownBase->ThreadGroupID) { D(DBF_STARTUP, "Cleaning up state %08lx for %08lx (group %lu)", a, a->pid, a->ThreadGroupID); h_delete(parentBase->thread_hash, a->pid); FreeVec(a); } }
void mntlist_delete(char *host, char *path) { struct mntentry *m, mm; mm.m_host = host; mm.m_path = path; (void) rw_wrlock(&rmtab_lock); if (m = (struct mntentry *)h_get(mntlist, &mm)) { rmtab_delete(m->m_pos); (void) h_delete(mntlist, m); free(m->m_path); free(m->m_host); free(m); if (RMTAB_TOOMANY_DELETED()) rmtab_rewrite(); } (void) rw_unlock(&rmtab_lock); }