diff options
Diffstat (limited to '')
-rw-r--r-- | src/notify.hxx (renamed from src/notify.h) | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/notify.h b/src/notify.hxx index 40821690c..6b9e95368 100644 --- a/src/notify.h +++ b/src/notify.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -17,37 +17,37 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MPD_NOTIFY_H -#define MPD_NOTIFY_H +#ifndef MPD_NOTIFY_HXX +#define MPD_NOTIFY_HXX -#include <glib.h> - -#include <stdbool.h> +#include "thread/Mutex.hxx" +#include "thread/Cond.hxx" struct notify { - GMutex *mutex; - GCond *cond; + Mutex mutex; + Cond cond; bool pending; -}; - -void notify_init(struct notify *notify); - -void notify_deinit(struct notify *notify); - -/** - * Wait for a notification. Return immediately if we have already - * been notified since we last returned from notify_wait(). - */ -void notify_wait(struct notify *notify); -/** - * Notify the thread. This function never blocks. - */ -void notify_signal(struct notify *notify); - -/** - * Clears a pending notification. - */ -void notify_clear(struct notify *notify); +#ifndef WIN32 + constexpr +#endif + notify():pending(false) {} + + /** + * Wait for a notification. Return immediately if we have already + * been notified since we last returned from notify_wait(). + */ + void Wait(); + + /** + * Notify the thread. This function never blocks. + */ + void Signal(); + + /** + * Clears a pending notification. + */ + void Clear(); +}; #endif |