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:
12
src/notify.h
12
src/notify.h
@@ -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);
|
||||
|
Reference in New Issue
Block a user