command: added command "idle"

"idle" waits until something noteworthy happens on the server,
e.g. song change, playlist modified, database updated.  This allows
clients to keep up to date without polling.
This commit is contained in:
Max Kellermann
2008-10-14 22:38:14 +02:00
parent 30c86d8ae6
commit a3e3d2c950
14 changed files with 305 additions and 3 deletions

View File

@@ -30,6 +30,7 @@
#include "main_notify.h"
#include "condition.h"
#include "update.h"
#include "idle.h"
static enum update_progress {
UPDATE_PROGRESS_IDLE = 0,
@@ -549,8 +550,10 @@ void reap_update_task(void)
if (pthread_join(update_thr, NULL))
FATAL("error joining update thread: %s\n", strerror(errno));
if (modified)
if (modified) {
playlistVersionChange();
idle_add(IDLE_DATABASE);
}
if (update_paths_nr) {
char *path = update_paths[0];