Skip to content

Commit b96ef6a

Browse files
committed
rename
1 parent c6675d8 commit b96ef6a

File tree

11 files changed

+59
-59
lines changed

11 files changed

+59
-59
lines changed

Zend/Zend.m4

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -269,27 +269,27 @@ fi
269269
AC_MSG_CHECKING(whether to enable zend signal handling)
270270
AC_MSG_RESULT($ZEND_SIGNALS)
271271
272-
dnl By default, enable Zend Timers only for ZTS builds
273-
AC_ARG_ENABLE([zend-timer],
274-
[AS_HELP_STRING([--enable-zend-timer],
275-
[whether to enable zend timer])],
276-
[ZEND_TIMERS=$enableval],
277-
[ZEND_TIMERS=$ZEND_ZTS])
272+
dnl By default, enable Zend Max Execution Timers only for ZTS builds
273+
AC_ARG_ENABLE([zend-max-execution-timers],
274+
[AS_HELP_STRING([--enable-zend-max-execution-timers],
275+
[whether to enable zend max execution timers])],
276+
[ZEND_MAX_EXECUTION_TIMERS=$enableval],
277+
[ZEND_MAX_EXECUTION_TIMERS=$ZEND_ZTS])
278278
279-
AS_CASE(["$host_alias"], [*linux*], [], [ZEND_TIMERS='no'])
279+
AS_CASE(["$host_alias"], [*linux*], [], [ZEND_MAX_EXECUTION_TIMERS='no'])
280280
281281
PHP_CHECK_FUNC(timer_create, rt)
282282
if test "$ac_cv_func_timer_create" != "yes"; then
283-
ZEND_TIMERS='no'
283+
ZEND_MAX_EXECUTION_TIMERS='no'
284284
fi
285285
286-
if test "$ZEND_TIMERS" = "yes"; then
287-
AC_DEFINE(ZEND_TIMERS, 1, [Use zend timer])
288-
CFLAGS="$CFLAGS -DZEND_TIMERS"
286+
if test "$ZEND_MAX_EXECUTION_TIMERS" = "yes"; then
287+
AC_DEFINE(ZEND_MAX_EXECUTION_TIMERS, 1, [Use zend max execution timers])
288+
CFLAGS="$CFLAGS -DZEND_MAX_EXECUTION_TIMERS"
289289
fi
290290
291-
AC_MSG_CHECKING(whether to enable zend timer)
292-
AC_MSG_RESULT($ZEND_TIMERS)
291+
AC_MSG_CHECKING(whether to enable zend max execution timers)
292+
AC_MSG_RESULT($ZEND_MAX_EXECUTION_TIMERS)
293293
294294
])
295295

Zend/zend.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "zend_attributes.h"
3636
#include "zend_observer.h"
3737
#include "zend_fibers.h"
38-
#include "zend_timer.h"
38+
#include "zend_max_execution_timer.h"
3939
#include "Optimizer/zend_optimizer.h"
4040

4141
static size_t global_map_ptr_last = 0;
@@ -822,7 +822,7 @@ static void zend_new_thread_end_handler(THREAD_T thread_id) /* {{{ */
822822
{
823823
zend_copy_ini_directives();
824824
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP);
825-
zend_timer_init();
825+
zend_max_execution_timer_init();
826826
}
827827
/* }}} */
828828
#endif

Zend/zend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "zend_smart_str_public.h"
4040
#include "zend_smart_string_public.h"
4141
#include "zend_signal.h"
42-
#include "zend_timer.h"
42+
#include "zend_max_execution_timer.h"
4343

4444
#define zend_sprintf sprintf
4545

Zend/zend_execute_API.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#ifdef HAVE_UNISTD_H
4444
#include <unistd.h>
4545
#endif
46-
#ifdef ZEND_TIMERS
46+
#ifdef ZEND_MAX_EXECUTION_TIMERS
4747
#include <sys/syscall.h>
4848
#endif
4949

@@ -195,7 +195,7 @@ void init_executor(void) /* {{{ */
195195
EG(num_errors) = 0;
196196
EG(errors) = NULL;
197197

198-
zend_timer_init();
198+
zend_max_execution_timer_init();
199199
zend_fiber_init();
200200
zend_weakrefs_init();
201201

@@ -407,7 +407,7 @@ void shutdown_executor(void) /* {{{ */
407407
zend_shutdown_executor_values(fast_shutdown);
408408

409409
zend_weakrefs_shutdown();
410-
zend_timer_shutdown();
410+
zend_max_execution_timer_shutdown();
411411
zend_fiber_shutdown();
412412

413413
zend_try {
@@ -1319,11 +1319,11 @@ ZEND_API ZEND_NORETURN void ZEND_FASTCALL zend_timeout(void) /* {{{ */
13191319
/* }}} */
13201320

13211321
#ifndef ZEND_WIN32
1322-
# ifdef ZEND_TIMERS
1322+
# ifdef ZEND_MAX_EXECUTION_TIMERS
13231323
static void zend_timeout_handler(int dummy, siginfo_t *si, void *uc) /* {{{ */
13241324
{
1325-
if (si->si_value.sival_ptr != &EG(timer)) {
1326-
#ifdef TIMER_DEBUG
1325+
if (si->si_value.sival_ptr != &EG(max_execution_timer_timer)) {
1326+
#ifdef MAX_EXECUTION_TIMERS_DEBUG
13271327
fprintf(stderr, "Executing previous handler (if set) for unexpected signal SIGRTMIN received on thread %d\n", (pid_t) syscall(SYS_gettid));
13281328
#endif
13291329

@@ -1439,8 +1439,8 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */
14391439
zend_error_noreturn(E_ERROR, "Could not queue new timer");
14401440
return;
14411441
}
1442-
#elif defined(ZEND_TIMERS)
1443-
zend_timer_settime(seconds);
1442+
#elif defined(ZEND_MAX_EXECUTION_TIMERS)
1443+
zend_max_execution_timer_settime(seconds);
14441444

14451445
if (reset_signals) {
14461446
sigset_t sigset;
@@ -1519,8 +1519,8 @@ void zend_unset_timeout(void) /* {{{ */
15191519
}
15201520
tq_timer = NULL;
15211521
}
1522-
#elif ZEND_TIMERS
1523-
zend_timer_settime(0);
1522+
#elif ZEND_MAX_EXECUTION_TIMERS
1523+
zend_max_execution_timer_settime(0);
15241524
#elif defined(HAVE_SETITIMER)
15251525
if (EG(timeout_seconds)) {
15261526
struct itimerval no_timeout;

Zend/zend_globals.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "zend_multibyte.h"
3838
#include "zend_multiply.h"
3939
#include "zend_arena.h"
40-
#include "zend_timer.h"
40+
#include "zend_max_execution_timer.h"
4141

4242
/* Define ZTS if you want a thread-safe Zend */
4343
/*#undef ZTS*/
@@ -268,8 +268,8 @@ struct _zend_executor_globals {
268268
uint32_t num_errors;
269269
zend_error_info **errors;
270270

271-
#ifdef ZEND_TIMERS
272-
timer_t timer;
271+
#ifdef ZEND_MAX_EXECUTION_TIMERS
272+
timer_t max_execution_timer_timer;
273273
pid_t pid;
274274
struct sigaction oldact;
275275
#endif

Zend/zend_timer.c renamed to Zend/zend_max_execution_timer.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17-
#ifdef ZEND_TIMERS
17+
#ifdef ZEND_MAX_EXECUTION_TIMERS
1818

1919
#include <stdio.h>
2020
#include <signal.h>
@@ -33,31 +33,31 @@
3333
# define sigev_notify_thread_id _sigev_un._tid
3434
# endif
3535

36-
ZEND_API void zend_timer_init(void) /* {{{ */
36+
ZEND_API void zend_max_execution_timer_init(void) /* {{{ */
3737
{
3838
struct sigevent sev;
3939
sev.sigev_notify = SIGEV_THREAD_ID;
40-
sev.sigev_value.sival_ptr = &EG(timer);
40+
sev.sigev_value.sival_ptr = &EG(max_execution_timer_timer);
4141
sev.sigev_signo = SIGRTMIN;
4242
sev.sigev_notify_thread_id = (pid_t) syscall(SYS_gettid);
4343

4444
EG(pid) = getpid();
4545
// 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
46-
if (timer_create(CLOCK_BOOTTIME, &sev, &EG(timer)) != 0) {
46+
if (timer_create(CLOCK_BOOTTIME, &sev, &EG(max_execution_timer_timer)) != 0) {
4747
zend_strerror_noreturn(E_ERROR, errno, "Could not create timer");
4848
}
4949

50-
# ifdef TIMER_DEBUG
51-
fprintf(stderr, "Timer %#jx created on thread %d\n", (uintmax_t) EG(timer), sev.sigev_notify_thread_id);
50+
# ifdef MAX_EXECUTION_TIMERS_DEBUG
51+
fprintf(stderr, "Timer %#jx created on thread %d\n", (uintmax_t) EG(max_execution_timer_timer), sev.sigev_notify_thread_id);
5252
# endif
5353

5454
sigaction(sev.sigev_signo, NULL, &EG(oldact));
5555
}
5656
/* }}} */
5757

58-
void zend_timer_settime(zend_long seconds) /* {{{ }*/
58+
void zend_max_execution_timer_settime(zend_long seconds) /* {{{ }*/
5959
{
60-
timer_t timer = EG(timer);
60+
timer_t timer = EG(max_execution_timer_timer);
6161

6262
/* Timer doesn't anymore on request shutdown. */
6363
if (timer == (timer_t){0}) {
@@ -68,7 +68,7 @@ void zend_timer_settime(zend_long seconds) /* {{{ }*/
6868
its.it_value.tv_sec = seconds;
6969
its.it_value.tv_nsec = its.it_interval.tv_sec = its.it_interval.tv_nsec = 0;
7070

71-
# ifdef TIMER_DEBUG
71+
# ifdef MAX_EXECUTION_TIMERS_DEBUG
7272
fprintf(stderr, "Setting timer %#jx on thread %d (%ld seconds)...\n", (uintmax_t) timer, (pid_t) syscall(SYS_gettid), seconds);
7373
# endif
7474

@@ -78,29 +78,29 @@ void zend_timer_settime(zend_long seconds) /* {{{ }*/
7878
}
7979
/* }}} */
8080

81-
void zend_timer_shutdown(void) /* {{{ */
81+
void zend_max_execution_timer_shutdown(void) /* {{{ */
8282
{
8383
/* Don't try to delete a timer created before a call to fork() */
8484
if (EG(pid) != getpid()) {
8585
return;
8686
}
8787

88-
timer_t timer = EG(timer);
88+
timer_t timer = EG(max_execution_timer_timer);
8989
if (timer == (timer_t){0}) {
9090
/* Don't trigger an error here because the timer may not be initialized when PHP fail early, and on threads created by PHP but not managed by it. */
91-
# ifdef TIMER_DEBUG
91+
# ifdef MAX_EXECUTION_TIMERS_DEBUG
9292
fprintf(stderr, "Could not delete timer that has not been created on thread %d\n", (uintmax_t) timer, (pid_t) syscall(SYS_gettid));
9393
# endif
9494

9595
return;
9696
}
9797

98-
# ifdef TIMER_DEBUG
98+
# ifdef MAX_EXECUTION_TIMERS_DEBUG
9999
fprintf(stderr, "Deleting timer %#jx on thread %d...\n", (uintmax_t) timer, (pid_t) syscall(SYS_gettid));
100100
# endif
101101

102102
int err = timer_delete(timer);
103-
EG(timer) = (timer_t){0};
103+
EG(max_execution_timer_timer) = (timer_t){0};
104104
if (err != 0) {
105105
zend_strerror_noreturn(E_ERROR, errno, "Could not delete timer");
106106
}

Zend/zend_timer.h renamed to Zend/zend_max_execution_timer.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17-
#ifndef ZEND_TIMER_H
18-
#define ZEND_TIMER_H
17+
#ifndef ZEND_MAX_EXECUTION_TIMER_H
18+
#define ZEND_MAX_EXECUTION_TIMER_H
1919

20-
# ifdef ZEND_TIMERS
20+
# ifdef ZEND_MAX_EXECUTION_TIMERS
2121

2222
#include "zend_long.h"
2323

2424
/* Must be called after calls to fork() */
25-
ZEND_API void zend_timer_init(void);
26-
void zend_timer_settime(zend_long seconds);
27-
void zend_timer_shutdown(void);
25+
ZEND_API void zend_max_execution_timer_init(void);
26+
void zend_max_execution_timer_settime(zend_long seconds);
27+
void zend_max_execution_timer_shutdown(void);
2828

2929
# else
3030

31-
#define zend_timer_init()
32-
#define zend_timer_settime(seconds)
33-
#define zend_timer_shutdown()
31+
#define zend_max_execution_timer_init()
32+
#define zend_max_execution_timer_settime(seconds)
33+
#define zend_max_execution_timer_shutdown()
3434

3535
# endif
3636
#endif

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,7 @@ PHP_ADD_SOURCES(Zend, \
16341634
zend_closures.c zend_weakrefs.c zend_float.c zend_string.c zend_signal.c zend_generators.c \
16351635
zend_virtual_cwd.c zend_ast.c zend_objects.c zend_object_handlers.c zend_objects_API.c \
16361636
zend_default_classes.c zend_inheritance.c zend_smart_str.c zend_cpuinfo.c zend_gdb.c \
1637-
zend_observer.c zend_system_id.c zend_enum.c zend_fibers.c zend_timer.c \
1637+
zend_observer.c zend_system_id.c zend_enum.c zend_fibers.c zend_max_execution_timer.c \
16381638
Optimizer/zend_optimizer.c \
16391639
Optimizer/pass1.c \
16401640
Optimizer/pass3.c \

ext/pcntl/pcntl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
# define NSIG 32
5151
#endif
5252

53-
#include "Zend/zend_timer.h"
53+
#include "Zend/zend_max_execution_timer.h"
5454

5555
ZEND_DECLARE_MODULE_GLOBALS(pcntl)
5656
static PHP_GINIT_FUNCTION(pcntl);
@@ -534,7 +534,7 @@ PHP_FUNCTION(pcntl_fork)
534534
PCNTL_G(last_error) = errno;
535535
php_error_docref(NULL, E_WARNING, "Error %d", errno);
536536
} else if (id == 0) {
537-
zend_timer_init();
537+
zend_max_execution_timer_init();
538538
}
539539

540540
RETURN_LONG((zend_long) id);

ext/standard/info.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,10 +891,10 @@ PHPAPI ZEND_COLD void php_print_info(int flag)
891891
efree(descr);
892892
}
893893

894-
#ifdef ZEND_TIMERS
895-
php_info_print_table_row(2, "Zend Timers", "enabled" );
894+
#ifdef ZEND_MAX_EXECUTION_TIMERS
895+
php_info_print_table_row(2, "Zend Max Execution Timers", "enabled" );
896896
#else
897-
php_info_print_table_row(2, "Zend Timers", "disabled" );
897+
php_info_print_table_row(2, "Zend Max Execution Timers", "disabled" );
898898
#endif
899899

900900
#if HAVE_IPV6

ext/standard/tests/general_functions/phpinfo.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Thread Safety => %s%A
3434
Zend Signal Handling => %s
3535
Zend Memory Manager => %s
3636
Zend Multibyte Support => %s
37-
Zend Timers => %s
37+
Zend Max Execution Timers => %s
3838
IPv6 Support => %s
3939
DTrace Support => %s
4040

0 commit comments

Comments
 (0)