static void dropVdb(PsmPartition wm, PsmAddress vdbAddress) { IonVdb *vdb; vdb = (IonVdb *) psp(wm, vdbAddress); /* Time-ordered list of probes can simply be destroyed. */ sm_list_destroy(wm, vdb->probes, rfx_erase_data, NULL); /* Three of the red-black tables in the Vdb are * emptied and recreated by rfx_stop(). Destroy them. */ sm_rbt_destroy(wm, vdb->contactIndex, NULL, NULL); sm_rbt_destroy(wm, vdb->rangeIndex, NULL, NULL); sm_rbt_destroy(wm, vdb->timeline, NULL, NULL); /* cgr_stop clears all routing objects, so nodes and * neighbors themselves can now be deleted. */ sm_rbt_destroy(wm, vdb->nodes, destroyIonNode, NULL); sm_rbt_destroy(wm, vdb->neighbors, rfx_erase_data, NULL); /* Safely delete the ZCO availability semaphore. */ sm_SemEnd(vdb->zcoSemaphore); sm_SemDelete(vdb->zcoSemaphore); vdb->zcoSemaphore = SM_SEM_NONE; vdb->zcoClaimants = 0; vdb->zcoClaims = 0; zco_unregister_callback(); }
static void destroyIonNode(PsmPartition partition, PsmAddress eltData, void *argument) { IonNode *node = (IonNode *) psp(partition, eltData); sm_list_destroy(partition, node->embargoes, rfx_erase_data, NULL); psm_free(partition, eltData); }
static void dropVdb(PsmPartition wm, PsmAddress vdbAddress) { IonVdb *vdb; int i; PsmAddress elt; PsmAddress nextElt; PsmAddress addr; Requisition *req; vdb = (IonVdb *) psp(wm, vdbAddress); /* Time-ordered list of probes can simply be destroyed. */ sm_list_destroy(wm, vdb->probes, rfx_erase_data, NULL); /* Three of the red-black tables in the Vdb are * emptied and recreated by rfx_stop(). Destroy them. */ sm_rbt_destroy(wm, vdb->contactIndex, NULL, NULL); sm_rbt_destroy(wm, vdb->rangeIndex, NULL, NULL); sm_rbt_destroy(wm, vdb->timeline, NULL, NULL); /* cgr_stop clears all routing objects, so nodes and * neighbors themselves can now be deleted. */ sm_rbt_destroy(wm, vdb->nodes, destroyIonNode, NULL); sm_rbt_destroy(wm, vdb->neighbors, rfx_erase_data, NULL); /* Safely shut down the ZCO flow control system. */ for (i = 0; i < 1; i++) { for (elt = sm_list_first(wm, vdb->requisitions[i]); elt; elt = nextElt) { nextElt = sm_list_next(wm, elt); addr = sm_list_data(wm, elt); req = (Requisition *) psp(wm, addr); sm_SemEnd(req->semaphore); psm_free(wm, addr); sm_list_delete(wm, elt, NULL, NULL); } } //zco_unregister_callback(); }