Skip to content

Commit

Permalink
unlock mutex in case of zend_bailout
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl committed Jul 8, 2024
1 parent de6ed3f commit 76e2420
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/parallel.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ PHP_RSHUTDOWN_FUNCTION(PARALLEL_CORE)

PHP_RSHUTDOWN(PARALLEL_COPY)(INIT_FUNC_ARGS_PASSTHRU);

// In case of a `zend_bailout()` this mutex could still be locked, so we
// unlock it just in case.
// See https://github.com/krakjoe/parallel/issues/313 for more details
if (CG(unclean_shutdown) == 1) {
pthread_mutex_unlock(&php_parallel_output_mutex);
}

return SUCCESS;
}
#endif

0 comments on commit 76e2420

Please sign in to comment.