From 8f4ebf0caf8514fb7838eb27b848e5a4cccaae12 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 24 Sep 2008 07:16:59 +0200 Subject: [PATCH] notify: added macro NOTIFY_INITIALIZER With the macro NOTIFY_INITIALIZER, you can statically initialize a notify object. --- src/notify.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/notify.h b/src/notify.h index e727a0a34..b9fd6e041 100644 --- a/src/notify.h +++ b/src/notify.h @@ -27,6 +27,11 @@ typedef struct notify { int pending; } Notify; +#define NOTIFY_INITIALIZER { \ + .mutex = PTHREAD_MUTEX_INITIALIZER, \ + .cond = PTHREAD_COND_INITIALIZER, \ +} + void notify_init(struct notify *notify); void notify_deinit(struct notify *notify);