Commit 59eefae1975daf9e0ad188e15fd6de93c1d216e7

Thomas de Grivel 2023-07-10T17:46:21

wip facts

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/libc3/facts.c b/libc3/facts.c
index fb9aa80..60cb193 100644
--- a/libc3/facts.c
+++ b/libc3/facts.c
@@ -374,9 +374,9 @@ void facts_lock_unlock_w (s_facts *facts)
   assert(facts);
   facts->rwlock_count--;
   if (! facts->rwlock_count) {
-    facts->rwlock_thread = 0;
     if (pthread_rwlock_unlock(&facts->rwlock))
       err(1, "facts_lock_unlock_w: pthread_rwlock_unlock");
+    facts->rwlock_thread = 0;
   }
 }