mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
fix: don't delete an unitialized timer (#12537)
This commit is contained in:
parent
bbfadd32e8
commit
39f3374be5
@ -41,12 +41,13 @@ ZEND_API void zend_max_execution_timer_init(void) /* {{{ */
|
|||||||
sev.sigev_signo = SIGRTMIN;
|
sev.sigev_signo = SIGRTMIN;
|
||||||
sev.sigev_notify_thread_id = (pid_t) syscall(SYS_gettid);
|
sev.sigev_notify_thread_id = (pid_t) syscall(SYS_gettid);
|
||||||
|
|
||||||
EG(pid) = getpid();
|
|
||||||
// Measure wall time instead of CPU time as originally planned now that it is possible https://github.com/php/php-src/pull/6504#issuecomment-1370303727
|
// Measure wall time instead of CPU time as originally planned now that it is possible https://github.com/php/php-src/pull/6504#issuecomment-1370303727
|
||||||
if (timer_create(CLOCK_BOOTTIME, &sev, &EG(max_execution_timer_timer)) != 0) {
|
if (timer_create(CLOCK_BOOTTIME, &sev, &EG(max_execution_timer_timer)) != 0) {
|
||||||
zend_strerror_noreturn(E_ERROR, errno, "Could not create timer");
|
zend_strerror_noreturn(E_ERROR, errno, "Could not create timer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
fprintf(stderr, "Timer %#jx created on thread %d\n", (uintmax_t) EG(max_execution_timer_timer), sev.sigev_notify_thread_id);
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
Reference in New Issue
Block a user