Commit 03e51dab32b2b9bb5e3f012bf2f432e76eb0abe8

Thomas de Grivel 2023-07-16T10:06:00

pthread ?

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/libc3/facts.c b/libc3/facts.c
index 74f553d..a008ea9 100644
--- a/libc3/facts.c
+++ b/libc3/facts.c
@@ -356,6 +356,8 @@ void facts_lock_r (s_facts *facts)
   pthread_t thread;
   assert(facts);
   thread = pthread_self();
+  if (facts->rwlock_thread == thread)
+    return;
   if (pthread_rwlock_rdlock(&facts->rwlock))
     errx(1, "facts_lock_r: pthread_rwlock_rdlock");
 }