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 22, 2024
1 parent a5db0d4 commit f0fdf94
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 f0fdf94

Please # to comment.