[php-src] PR #15522: Add TSRM free thread handlers
| From: | realFlowControl | Date: | Wed, 21 Aug 2024 14:36:25 +0000 |
| Subject: | [php-src] PR #15522: Add TSRM free thread handlers | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-28103@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15522
Author: realFlowControl
Hey folks,
I needed to observe new thread initialisation and found (thanks to the help of @bwoebi) that there
is a
tsrm_set_new_thread_begin_handler and a
tsrm_set_new_thread_end_handler functions that I could use. Now I see that there is no
handler for when the thread gets freed (and joined), just a tsrm_set_shutdown_handler
for when the TSRM shuts down.
This PR aim is to add the missing free thread handlers.
Alternative considered: I am working on an extension that does not have globals, so
globals_ctor and globals_dtor won't be called, I could fake create
globals that I do not use in order to get GINIT/GSHUTDOWN working, but
that seems just wrong, although technically working 😉