Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Zend/zend_max_execution_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@

ZEND_API void zend_max_execution_timer_init(void) /* {{{ */
{
pid_t pid = getpid();

if (EG(pid) == pid) {
return;
}

struct sigevent sev;
sev.sigev_notify = SIGEV_THREAD_ID;
sev.sigev_value.sival_ptr = &EG(max_execution_timer_timer);
Expand All @@ -48,9 +54,9 @@ ZEND_API void zend_max_execution_timer_init(void) /* {{{ */

EG(pid) = getpid();

# ifdef MAX_EXECUTION_TIMERS_DEBUG
# ifdef MAX_EXECUTION_TIMERS_DEBUG
fprintf(stderr, "Timer %#jx created on thread %d\n", (uintmax_t) EG(max_execution_timer_timer), sev.sigev_notify_thread_id);
# endif
# endif

sigaction(sev.sigev_signo, NULL, &EG(oldact));
}
Expand Down