X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Futil.c;h=f7335cf279770bbc0d8f243b06205d1d53c23b33;hp=cdc58e394f1e77fbe9ed329dc2054ae299d03c77;hb=ec202eae8e84a4c99f054f771cb832046cb8769f;hpb=06db8540cdfc8259423ed90e7352dbc1d71eccd9;ds=sidebyside diff --git a/src/shared/util.c b/src/shared/util.c index cdc58e394..f7335cf27 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -86,7 +86,7 @@ static volatile unsigned cached_columns = 0; static volatile unsigned cached_lines = 0; size_t page_size(void) { - static __thread size_t pgsz = 0; + static thread_local size_t pgsz = 0; long r; if (_likely_(pgsz > 0)) @@ -4580,7 +4580,7 @@ char *strjoin(const char *x, ...) { } bool is_main_thread(void) { - static __thread int cached = 0; + static thread_local int cached = 0; if (_unlikely_(cached == 0)) cached = getpid() == gettid() ? 1 : -1; @@ -4798,7 +4798,7 @@ static const char *const __signal_table[] = { DEFINE_PRIVATE_STRING_TABLE_LOOKUP(__signal, int); const char *signal_to_string(int signo) { - static __thread char buf[sizeof("RTMIN+")-1 + DECIMAL_STR_MAX(int) + 1]; + static thread_local char buf[sizeof("RTMIN+")-1 + DECIMAL_STR_MAX(int) + 1]; const char *name; name = __signal_to_string(signo);