git » libfiu » commit aa74075

Initialize rwlock in fiu.c

author Alberto Bertogli
2009-06-15 01:19:28 UTC
committer Alberto Bertogli
2009-06-15 02:04:40 UTC
parent 12ef3e8d301abfd7e4295092061f04b416b3c148

Initialize rwlock in fiu.c

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libfiu/fiu.c +1 -1

diff --git a/libfiu/fiu.c b/libfiu/fiu.c
index dad5803..fbec161 100644
--- a/libfiu/fiu.c
+++ b/libfiu/fiu.c
@@ -52,7 +52,7 @@ static struct pf_info *enabled_fails = NULL;
 static struct pf_info *enabled_fails_last = NULL;
 static size_t enabled_fails_len = 0;
 static size_t enabled_fails_nfree = 0;
-static pthread_rwlock_t enabled_fails_lock;
+static pthread_rwlock_t enabled_fails_lock = PTHREAD_RWLOCK_INITIALIZER;
 #define ef_rlock() do { pthread_rwlock_rdlock(&enabled_fails_lock); } while (0)
 #define ef_wlock() do { pthread_rwlock_wrlock(&enabled_fails_lock); } while (0)
 #define ef_runlock() do { pthread_rwlock_unlock(&enabled_fails_lock); } while (0)