示例#1
0
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 */
}
示例#2
0
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;
	}
}
示例#3
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;
}
示例#4
0
void tree_close(void)
{
	tree_flush(tree_get());
}