Skip to content

Commit 7113811

Browse files
enjoy-binbinnaglera
authored andcommitted
Use _Thread_local to solve threads.h build issue (valkey-io#1053)
Apparently this will fail to compile in some masOS version. And internet claims _Thread_local is portable. Fixes valkey-io#1051. Signed-off-by: Binbin <[email protected]> Signed-off-by: naglera <[email protected]>
1 parent 8173e13 commit 7113811

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/zmalloc.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,7 @@ void zlibc_free(void *ptr) {
8888
#define dallocx(ptr, flags) je_dallocx(ptr, flags)
8989
#endif
9090

91-
#if __STDC_NO_THREADS__
92-
#define thread_local __thread
93-
#else
94-
#include <threads.h>
95-
#endif
91+
#define thread_local _Thread_local
9692

9793
#define MAX_THREADS_NUM (IO_THREADS_MAX_NUM + 3 + 1)
9894
/* A thread-local storage which keep the current thread's index in the used_memory_thread array. */

0 commit comments

Comments
 (0)