Skip to content

Commit 5fdaf59

Browse files
committed
#19: Changes in the Zend Async API shutdown mechanism
1 parent 3a89d8f commit 5fdaf59

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Zend/zend_async_API.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,13 @@ void zend_async_globals_dtor(void)
197197
#endif
198198
}
199199

200-
void zend_async_shutdown(void)
200+
void zend_async_api_shutdown(void)
201201
{
202-
zend_async_globals_dtor();
203202
zend_async_internal_context_api_shutdown();
204203
zend_async_main_handlers_shutdown();
204+
#ifndef ZTS
205+
zend_async_globals_dtor();
206+
#endif
205207
}
206208

207209
ZEND_API int zend_async_get_api_version_number(void)

Zend/zend_async_API.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ ZEND_API bool zend_async_is_enabled(void);
11111111
ZEND_API bool zend_scheduler_is_enabled(void);
11121112

11131113
void zend_async_init(void);
1114-
void zend_async_shutdown(void);
1114+
void zend_async_api_shutdown(void);
11151115
void zend_async_globals_ctor(void);
11161116
void zend_async_globals_dtor(void);
11171117

main/main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,12 +2515,13 @@ void php_module_shutdown(void)
25152515

25162516
module_initialized = false;
25172517

2518+
#ifdef PHP_ASYNC_API
2519+
zend_async_api_shutdown();
2520+
#endif
2521+
25182522
#ifndef ZTS
25192523
core_globals_dtor(&core_globals);
25202524
gc_globals_dtor();
2521-
#ifdef PHP_ASYNC_API
2522-
zend_async_globals_dtor();
2523-
#endif
25242525
#else
25252526
ts_free_id(core_globals_id);
25262527
#endif

0 commit comments

Comments
 (0)