@@ -188,10 +188,13 @@ void init_executor(void) /* {{{ */
188
188
sev .sigev_signo = SIGIO ;
189
189
sev .sigev_notify_thread_id = (pid_t ) syscall (SYS_gettid );
190
190
191
- if (timer_create (CLOCK_THREAD_CPUTIME_ID , & sev , & EG (timer )) != 0 )
192
- fprintf (stderr , "error %d while creating timer on thread %d\n" , errno , (pid_t ) syscall (SYS_gettid ));
191
+ if (timer_create (CLOCK_THREAD_CPUTIME_ID , & sev , & EG (timer )) != 0 ) {
193
192
# ifdef TIMER_DEBUG
194
- else fprintf (stderr , "timer created on thread %d\n" , syscall (SYS_gettid ));
193
+ fprintf (stderr , "error %d while creating timer %#jx on thread %d\n" , errno , (uintmax_t ) EG (timer ), (pid_t ) syscall (SYS_gettid ));
194
+ # endif
195
+ }
196
+ # ifdef TIMER_DEBUG
197
+ else fprintf (stderr , "timer %#jx created on thread %d\n" , (uintmax_t ) EG (timer ), syscall (SYS_gettid ));
195
198
# endif
196
199
#endif
197
200
@@ -421,10 +424,13 @@ void shutdown_executor(void) /* {{{ */
421
424
#endif
422
425
423
426
#if defined(ZTS ) && defined(HAVE_TIMER_CREATE )
424
- if (timer_delete (EG (timer )) != 0 )
425
- fprintf (stderr , "error %d while deleting timer on thread %d\n" , errno , (pid_t ) syscall (SYS_gettid ));
427
+ if (timer_delete (EG (timer )) != 0 ) {
428
+ # ifdef TIMER_DEBUG
429
+ fprintf (stderr , "error %d while deleting timer %#jx on thread %d\n" , errno , (uintmax_t ) EG (timer ), (pid_t ) syscall (SYS_gettid ));
430
+ # endif
431
+ }
426
432
# ifdef TIMER_DEBUG
427
- else fprintf (stderr , "timer deleted on thread %d\n" , (pid_t ) syscall (SYS_gettid ));
433
+ else fprintf (stderr , "timer %#jx deleted on thread %d\n" , ( uintmax_t ) EG ( timer ) , (pid_t ) syscall (SYS_gettid ));
428
434
# endif
429
435
#endif
430
436
@@ -1350,7 +1356,9 @@ ZEND_API ZEND_NORETURN void ZEND_FASTCALL zend_timeout(void) /* {{{ */
1350
1356
static void zend_timeout_handler (int dummy , siginfo_t * si , void * uc ) /* {{{ */
1351
1357
{
1352
1358
if (si -> si_value .sival_ptr != & EG (timer )) {
1359
+ #ifdef TIMER_DEBUG
1353
1360
fprintf (stderr , "ignoring timeout signal SIGIO received on thread %d\n" , (pid_t ) syscall (SYS_gettid ));
1361
+ #endif
1354
1362
1355
1363
return ;
1356
1364
}
@@ -1467,12 +1475,14 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */
1467
1475
its .it_interval .tv_nsec = 0 ;
1468
1476
1469
1477
if (timer_settime (timer , 0 , & its , NULL ) != 0 ) {
1470
- fprintf (stderr , "unable to set timer on thread %d\n" , (pid_t ) syscall (SYS_gettid ));
1478
+ #ifdef TIMER_DEBUG
1479
+ fprintf (stderr , "unable to set timer %#jx on thread %d\n" , (uintmax_t ) timer , (pid_t ) syscall (SYS_gettid ));
1480
+ #endif
1471
1481
1472
1482
return ;
1473
1483
}
1474
1484
# ifdef TIMER_DEBUG
1475
- else fprintf (stderr , "timer set on thread %d (%ld seconds)\n" , (pid_t ) syscall (SYS_gettid ), seconds );
1485
+ else fprintf (stderr , "timer %#jx set on thread %d (%ld seconds)\n" , ( uintmax_t ) timer , (pid_t ) syscall (SYS_gettid ), seconds );
1476
1486
# endif
1477
1487
1478
1488
if (reset_signals ) {
0 commit comments