switch everything to the now-standardized thread_local

We're only using compilers new enough to support it now, so just use it
without a compatibility layer in between.

Change-Id: I97a24ed344e3d4ccde0b04af9c44995cf417a635
diff --git a/aos/common/libc/aos_strerror.cc b/aos/common/libc/aos_strerror.cc
index 4bca500..2c9735d 100644
--- a/aos/common/libc/aos_strerror.cc
+++ b/aos/common/libc/aos_strerror.cc
@@ -5,8 +5,6 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "aos/linux_code/thread_local.h"
-
 // This code uses an overloaded function to handle the result from either
 // version of strerror_r correctly without needing a way to get the choice out
 // of the compiler/glibc/whatever explicitly.
@@ -35,7 +33,7 @@
 }  // namespace
 
 const char *aos_strerror(int error) {
-  static AOS_THREAD_LOCAL char buffer[kBufferSize];
+  static thread_local char buffer[kBufferSize];
 
   // Call the overload for whichever version we're using.
   return aos_strerror_handle_result(
diff --git a/aos/common/libc/aos_strsignal.cc b/aos/common/libc/aos_strsignal.cc
index 5fae327..2321a07 100644
--- a/aos/common/libc/aos_strsignal.cc
+++ b/aos/common/libc/aos_strsignal.cc
@@ -2,11 +2,10 @@
 
 #include <signal.h>
 
-#include "aos/linux_code/thread_local.h"
 #include "aos/common/logging/logging.h"
 
 const char *aos_strsignal(int signal) {
-  static AOS_THREAD_LOCAL char buffer[512];
+  static thread_local char buffer[512];
 
   if (signal >= SIGRTMIN && signal <= SIGRTMAX) {
     CHECK(snprintf(buffer, sizeof(buffer), "Real-time signal %d",
diff --git a/aos/linux_code/ipc_lib/aos_sync.cc b/aos/linux_code/ipc_lib/aos_sync.cc
index 311d88d..1275bbf 100644
--- a/aos/linux_code/ipc_lib/aos_sync.cc
+++ b/aos/linux_code/ipc_lib/aos_sync.cc
@@ -21,7 +21,6 @@
 #include <algorithm>
 
 #include "aos/common/logging/logging.h"
-#include "aos/linux_code/thread_local.h"
 #include "aos/common/once.h"
 #include "aos/common/macros.h"
 
@@ -182,7 +181,7 @@
 
 // Starts off at 0 in each new thread (because that's what it gets initialized
 // to in most of them or it gets to reset to 0 after a fork by atfork_child()).
-AOS_THREAD_LOCAL pid_t my_tid = 0;
+thread_local pid_t my_tid = 0;
 
 // Gets called before the fork(2) wrapper function returns in the child.
 void atfork_child() {
diff --git a/aos/linux_code/logging/linux_interface.cc b/aos/linux_code/logging/linux_interface.cc
index 626b2ee..b0a5c1b 100644
--- a/aos/linux_code/logging/linux_interface.cc
+++ b/aos/linux_code/logging/linux_interface.cc
@@ -3,7 +3,6 @@
 #include <sys/prctl.h>
 
 #include "aos/linux_code/complex_thread_local.h"
-#include "aos/linux_code/thread_local.h"
 #include "aos/common/die.h"
 
 namespace aos {
@@ -47,7 +46,7 @@
 // reason for doing this instead of just deleting them is that tsan (at least)
 // doesn't like it when pthread_atfork handlers do complicated stuff and it's
 // not a great idea anyways.
-AOS_THREAD_LOCAL bool delete_current_context(false);
+thread_local bool delete_current_context(false);
 
 }  // namespace
 
diff --git a/aos/linux_code/thread_local.h b/aos/linux_code/thread_local.h
deleted file mode 100644
index 503e18c..0000000
--- a/aos/linux_code/thread_local.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef AOS_LINUX_CODE_THREAD_LOCAL_H_
-#define AOS_LINUX_CODE_THREAD_LOCAL_H_
-
-// The storage class to use when declaring thread-local variables. This provides
-// a single place to change it if/when we want to switch to something standard.
-//
-// Example: AOS_THREAD_LOCAL void *bla;  // at namespace (aka global) scope
-//
-// C++11 has thread_local, but it's not clear whether Clang supports that as of
-// 12/18/12.
-#define AOS_THREAD_LOCAL __thread
-
-#endif  // AOS_LINUX_CODE_THREAD_LOCAL_H_