Skip to content

Commit b4718e0

Browse files
committed
use ZEND_TLS to define thread local storage
1 parent 6e251a1 commit b4718e0

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

Zend/zend_max_execution_timer.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@
2626

2727
#include "zend.h"
2828
#include "zend_globals.h"
29-
#include "zend_portability.h"
3029

3130
// Musl Libc defines this macro, glibc does not
3231
// According to "man 2 timer_create" this field should always be available, but it's not: https://sourceware.org/bugzilla/show_bug.cgi?id=27417
3332
# ifndef sigev_notify_thread_id
3433
# define sigev_notify_thread_id _sigev_un._tid
3534
# endif
3635

37-
ZEND_THREAD_LOCAL bool is_handler_set = false; // whether we have set up a timer in this thread
36+
ZEND_TLS bool is_handler_set = false; // whether we have set up a timer in this thread
3837

3938
ZEND_API void zend_max_execution_timer_init(void) /* {{{ */
4039
{

Zend/zend_portability.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -307,24 +307,6 @@ char *alloca();
307307
# define ZEND_NORETURN
308308
#endif
309309

310-
#if !defined(__STDC_NO_THREADS__)
311-
# if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9))
312-
/* GCC supported _Thread_local keyword since version 4.8.0 */
313-
# define ZEND_THREAD_LOCAL
314-
# else
315-
# define ZEND_THREAD_LOCAL _Thread_local
316-
# endif
317-
#else
318-
# if defined(_MSC_VER) && _MSC_VER >= 1900
319-
# define ZEND_THREAD_LOCAL __declspec(thread)
320-
# elif defined(__GNUC__) || defined(__clang__)
321-
# define ZEND_THREAD_LOCAL __thread
322-
# else
323-
/* TODO: add support for more compilers */
324-
# define ZEND_THREAD_LOCAL
325-
# endif
326-
#endif
327-
328310
#if __has_attribute(force_align_arg_pointer)
329311
# define ZEND_STACK_ALIGNED __attribute__((force_align_arg_pointer))
330312
#else

0 commit comments

Comments
 (0)