This is an automated email from the ASF dual-hosted git repository.
jamesge pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git
The following commit(s) were added to refs/heads/master by this push:
new 6efb0cf Not define thread_local for scenarios with c++11 off
6efb0cf is described below
commit 6efb0cff5f30f32437c660cef01c93549cf62679
Author: jamesge <[email protected]>
AuthorDate: Thu Nov 14 02:03:20 2019 -0800
Not define thread_local for scenarios with c++11 off
---
src/butil/thread_local.h | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/src/butil/thread_local.h b/src/butil/thread_local.h
index 2baf62c..f43675e 100644
--- a/src/butil/thread_local.h
+++ b/src/butil/thread_local.h
@@ -25,22 +25,6 @@
#include <cstddef> // NULL
#include "butil/macros.h"
-// Provide thread_local keyword (for primitive types) before C++11
-// DEPRECATED: define this keyword before C++11 might make the variable ABI
-// incompatible between C++11 and C++03
-#if !defined(thread_local) && \
- (__cplusplus < 201103L || \
- (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800)
-// GCC supports thread_local keyword of C++11 since 4.8.0
-#ifdef _MSC_VER
-// WARNING: don't use this macro in C++03
-#define thread_local __declspec(thread)
-#else
-// WARNING: don't use this macro in C++03
-#define thread_local __thread
-#endif // _MSC_VER
-#endif
-
#ifdef _MSC_VER
#define BAIDU_THREAD_LOCAL __declspec(thread)
#else
@@ -58,9 +42,8 @@ template <typename T> inline T* get_thread_local();
// thread, fn will be called at program termination. Calling sequence is LIFO:
// last registered function will be called first. Duplication of functions
// are not checked. This function is often used for releasing thread-local
-// resources declared with __thread (or thread_local defined in
-// butil/thread_local.h) which is much faster than pthread_getspecific or
-// boost::thread_specific_ptr.
+// resources declared with __thread which is much faster than
+// pthread_getspecific or boost::thread_specific_ptr.
// Returns 0 on success, -1 otherwise and errno is set.
int thread_atexit(void (*fn)());
int thread_atexit(void (*fn)(void*), void* arg);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]