Commit a7a5015a2e7a07a77b2ffc895b83203b51486004

Thomas de Grivel 2023-07-11T09:01:58

wip facts rwlock

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/libc3/facts.c b/libc3/facts.c
index 60cb193..6624d02 100644
--- a/libc3/facts.c
+++ b/libc3/facts.c
@@ -389,6 +389,7 @@ void facts_lock_w (s_facts *facts)
     if (pthread_rwlock_wrlock(&facts->rwlock))
       errx(1, "facts_lock_w: pthread_rwlock_wrlock");
     facts->rwlock_thread = thread;
+    facts->rwlock_count = 1;
   }
   facts->rwlock_count++;
 }