Commit 3afffc9f2442a1bb9584a2d6f69b5632eef6c29e

Thomas de Grivel 2024-07-25T12:53:39

abort on lock failure

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/libkc3/facts_cursor.c b/libkc3/facts_cursor.c
index 8002419..41b819c 100644
--- a/libkc3/facts_cursor.c
+++ b/libkc3/facts_cursor.c
@@ -104,6 +104,7 @@ s_facts_cursor * facts_cursor_lock_init (s_facts_cursor *cursor)
   if (pthread_mutex_init(&cursor->mutex, NULL)) {
     err_puts("facts_cursor_lock_init: pthread_mutex_init");
     assert(! "facts_cursor_lock_init: pthread_mutex_init");
+    abort();
     return NULL;
   }
   return cursor;
@@ -116,7 +117,7 @@ s_facts_cursor * facts_cursor_lock_unlock (s_facts_cursor *cursor)
   if (pthread_mutex_unlock(&cursor->mutex)) {
     err_puts("facts_cursor_lock_unlock: pthread_mutex_unlock");
     assert(! "facts_cursor_lock_unlock: pthread_mutex_unlock");
-    exit(1);
+    abort();
     return NULL;
   }
   return cursor;