Skip to content

Commit 0a44aa0

Browse files
committed
reduce API surface
1 parent a7776c3 commit 0a44aa0

File tree

9 files changed

+15
-14
lines changed

9 files changed

+15
-14
lines changed

Zend/zend.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,15 +823,15 @@ static void zend_new_thread_end_handler(THREAD_T thread_id) /* {{{ */
823823
zend_copy_ini_directives();
824824
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP);
825825
#ifdef ZEND_TIMERS
826-
zend_timers_create();
826+
zend_timers_startup();
827827
#endif
828828
}
829829
/* }}} */
830830

831831
static void zend_thread_shutdown_handler(void) { /* {{{ */
832832
zend_interned_strings_dtor();
833833
#ifdef ZEND_TIMERS
834-
zend_timers_delete();
834+
zend_timers_shutdown();
835835
#endif
836836
}
837837
/* }}} */

Zend/zend_execute_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void init_executor(void) /* {{{ */
174174
EG(vm_interrupt) = 0;
175175
EG(timed_out) = 0;
176176
#ifdef ZEND_TIMERS
177-
zend_timers_create();
177+
zend_timers_startup();
178178
#endif
179179

180180
EG(exception) = NULL;

Zend/zend_timers.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# define sigev_notify_thread_id _sigev_un._tid
3434
# endif
3535

36-
ZEND_API void zend_timers_create(void) /* {{{ */
36+
ZEND_API void zend_timers_startup(void) /* {{{ */
3737
{
3838
struct sigevent sev;
3939
sev.sigev_notify = SIGEV_THREAD_ID;
@@ -47,6 +47,7 @@ ZEND_API void zend_timers_create(void) /* {{{ */
4747
sev.sigev_signo = SIGIO;
4848
sev.sigev_notify_thread_id = (pid_t) syscall(SYS_gettid);
4949

50+
// 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
5051
if (timer_create(CLOCK_REALTIME, &sev, &EG(timer)) != 0) {
5152
zend_strerror_noreturn(E_ERROR, errno, "Could not create timer");
5253
}
@@ -59,7 +60,7 @@ ZEND_API void zend_timers_create(void) /* {{{ */
5960
}
6061
/* }}} */
6162

62-
ZEND_API void zend_timers_settime(zend_long seconds) /* {{{ }*/
63+
void zend_timers_settime(zend_long seconds) /* {{{ }*/
6364
{
6465
timer_t timer = EG(timer);
6566

@@ -77,7 +78,7 @@ ZEND_API void zend_timers_settime(zend_long seconds) /* {{{ }*/
7778
}
7879
/* }}} */
7980

80-
ZEND_API void zend_timers_delete(void) /* {{{ */
81+
void zend_timers_shutdown(void) /* {{{ */
8182
{
8283
timer_t timer = EG(timer);
8384
if (timer == (timer_t){0}) {

Zend/zend_timers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
#include "zend_long.h"
2323

24-
ZEND_API void zend_timers_create(void);
25-
ZEND_API void zend_timers_settime(zend_long seconds);
26-
ZEND_API void zend_timers_delete(void);
24+
ZEND_API void zend_timers_startup(void);
25+
void zend_timers_settime(zend_long seconds);
26+
void zend_timers_shutdown(void);
2727

2828
# endif
2929
#endif

ext/opcache/ZendAccelerator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4694,7 +4694,7 @@ static int accel_finish_startup(void)
46944694
exit(1);
46954695
}
46964696
#ifdef ZEND_TIMERS
4697-
zend_timers_create();
4697+
zend_timers_startup();
46984698
#endif
46994699
in_child = 1;
47004700
} else { /* parent */

ext/pcntl/pcntl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ PHP_FUNCTION(pcntl_fork)
535535
php_error_docref(NULL, E_WARNING, "Error %d", errno);
536536
} else if (id == 0) {
537537
#ifdef ZEND_TIMERS
538-
zend_timers_create();
538+
zend_timers_startup();
539539
#endif
540540
}
541541

sapi/cgi/cgi_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ consult the installation file that came with this distribution, or visit \n\
20552055
zend_signal_init();
20562056

20572057
#if ZEND_TIMERS
2058-
zend_timers_create();
2058+
zend_timers_startup();
20592059
#endif
20602060
break;
20612061
case -1:

sapi/cli/php_cli_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2402,7 +2402,7 @@ static void php_cli_server_startup_workers(void) {
24022402
return;
24032403
} else {
24042404
#if ZEND_TIMERS
2405-
zend_timers_create();
2405+
zend_timers_startup();
24062406
#endif
24072407

24082408
php_cli_server_workers[php_cli_server_worker] = pid;

sapi/fpm/fpm/fpm_php.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ int fpm_php_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
218218
}
219219

220220
#if ZEND_TIMERS
221-
zend_timers_create();
221+
zend_timers_startup();
222222
#endif
223223

224224
if (wp->limit_extensions) {

0 commit comments

Comments
 (0)