We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c028fda commit 48a2fe3Copy full SHA for 48a2fe3
api/include/opentelemetry/trace/tracer.h
@@ -233,8 +233,11 @@ class Tracer
233
234
private:
235
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
236
- // variable to support implementation of Enabled method introduced in ABI V2.
237
- bool enabled_ = true;
+ // Variable to support implementation of Enabled method introduced in ABI V2.
+ // Mutable allows enabled_ to be used as 'bool *' (instead of 'const bool *'), with the
238
+ // OPENTELEMETRY_ATOMIC_READ_8 macro's internal casts when used from a const function.
239
+ // std::atomic can not be used here because it is not ABI compatible for OpenTelemetry C++ API.
240
+ mutable bool enabled_ = true;
241
#endif
242
};
243
} // namespace trace
0 commit comments