We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4ee610 commit f782922Copy full SHA for f782922
opencensus/context/internal/context.cc
@@ -22,12 +22,6 @@
22
#include "opencensus/tags/tag_map.h"
23
#include "opencensus/trace/span.h"
24
25
-#if defined(_MSC_VER)
26
-#define TLS __declspec(thread)
27
-#else
28
-#define TLS __thread
29
-#endif
30
-
31
namespace opencensus {
32
namespace context {
33
@@ -54,7 +48,7 @@ std::string Context::DebugString() const {
54
48
55
49
// static
56
50
Context* Context::InternalMutableCurrent() {
57
- static TLS Context* thread_ctx = nullptr;
51
+ static thread_local Context* thread_ctx = nullptr;
58
52
if (thread_ctx == nullptr) thread_ctx = new Context;
59
53
return thread_ctx;
60
}
0 commit comments