notify: use GLib locking

Use GLib locking (GMutex, GCond) instead of pthread because GLib is
more portable, e.g. on mingw32.
This commit is contained in:
Max Kellermann
2008-12-27 20:56:06 +01:00
parent e8c44782d0
commit ed9668f638
3 changed files with 15 additions and 27 deletions

View File

@@ -19,20 +19,16 @@
#ifndef MPD_NOTIFY_H
#define MPD_NOTIFY_H
#include <glib.h>
#include <stdbool.h>
#include <pthread.h>
struct notify {
pthread_mutex_t mutex;
pthread_cond_t cond;
GMutex *mutex;
GCond *cond;
bool pending;
};
#define NOTIFY_INITIALIZER { \
.mutex = PTHREAD_MUTEX_INITIALIZER, \
.cond = PTHREAD_COND_INITIALIZER, \
}
void notify_init(struct notify *notify);
void notify_deinit(struct notify *notify);