Skip to content

Commit

Permalink
Ignore pthread_cond_destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
dinosaure committed Dec 6, 2024
1 parent 52c9f8d commit 809c56c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nolibc/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
int __unsup_##function(void) \
{ \
printf("STUB: abort: %s() called\n", #function); \
abort(); \
abort(); \
}

/*
Expand Down Expand Up @@ -134,7 +134,13 @@ STUB_IGNORE(int, pthread_condattr_init, 0);
*/

STUB_IGNORE(int, pthread_cond_init, 0);
STUB_ABORT(pthread_cond_destroy);
STUB_IGNORE(int, pthread_cond_destroy, 0);
/* it's possible to create a [Stdlib.Condition.t] but an execution path exists
* where we don't really use it. However, OCaml will try to destroy this
* [Stdlib.Condition.t] and we must ignore such execution path which is still
* safe for unikernels (with one core). The real issue with [pthread_cond_*] is
* when we would like to suspend the execution with [pthread_cond_wait] but
* [pthread_cond_init] and [pthread_cond_destroy] are safe to just ignore. */
STUB_ABORT(pthread_cond_wait);
STUB_ABORT(pthread_cond_signal);
STUB_IGNORE(int, pthread_cond_broadcast, 0);
Expand Down

0 comments on commit 809c56c

Please sign in to comment.