Skip to content

Commit 365178a

Browse files
committed
Move tsrm_is_managed_thread() check after tsrm_is_shutdown()
1 parent 265f399 commit 365178a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Zend/zend_signal.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,18 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
8787
zend_signal_queue_t *queue, *qtmp;
8888

8989
#ifdef ZTS
90-
if (!tsrm_is_managed_thread()) {
91-
fprintf(stderr, "zend_signal_handler_defer() called in a thread not managed by PHP. The expected signal handler will not be called. This is probably a bug.\n");
92-
93-
return;
94-
}
95-
9690
/* A signal could hit after TSRM shutdown, in this case globals are already freed. */
9791
if (tsrm_is_shutdown()) {
9892
/* Forward to default handler handler */
9993
zend_signal_handler(signo, siginfo, context);
10094
return;
10195
}
96+
97+
if (!tsrm_is_managed_thread()) {
98+
fprintf(stderr, "zend_signal_handler_defer() called in a thread not managed by PHP. The expected signal handler will not be called. This is probably a bug.\n");
99+
100+
return;
101+
}
102102
#endif
103103

104104
if (EXPECTED(SIGG(active))) {

0 commit comments

Comments
 (0)