Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit f782922

Browse files
authored
Use C++11 thread_local instead of compiler extensions. (#280)
1 parent c4ee610 commit f782922

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

opencensus/context/internal/context.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222
#include "opencensus/tags/tag_map.h"
2323
#include "opencensus/trace/span.h"
2424

25-
#if defined(_MSC_VER)
26-
#define TLS __declspec(thread)
27-
#else
28-
#define TLS __thread
29-
#endif
30-
3125
namespace opencensus {
3226
namespace context {
3327

@@ -54,7 +48,7 @@ std::string Context::DebugString() const {
5448

5549
// static
5650
Context* Context::InternalMutableCurrent() {
57-
static TLS Context* thread_ctx = nullptr;
51+
static thread_local Context* thread_ctx = nullptr;
5852
if (thread_ctx == nullptr) thread_ctx = new Context;
5953
return thread_ctx;
6054
}

0 commit comments

Comments
 (0)