static void system_flush(void) { scrobbler_shutdown(); playlist_shutdown(); tree_flush(); call_storage_idle_notifys(true); /*doesnt work on usb and shutdown from ata thread */ }
void tree_close(void) { if (shared_tree) tree_flush(tree_get()); shared_tree = NULL; if (shared_tree_lock) { lock_destroy(shared_tree_lock); lock_dealloc(shared_tree_lock); shared_tree_lock=0; } }
int tree_swap(struct tree_item *root) { struct tree *new_tree, *old_tree; new_tree = tree_alloc(); if (NULL == new_tree) return -1; new_tree->root = root; /* Save old tree */ old_tree = tree_get(); /* Critical - swap trees */ lock_get(shared_tree_lock); *shared_tree = new_tree; lock_release(shared_tree_lock); /* Flush old tree */ tree_flush(old_tree); return 0; }
void tree_close(void) { tree_flush(tree_get()); }