private void EnsureNativeIsIntialized()
        {
            if (_isInitialized)
            {
                return;
            }

            lock (_lockObj)
            {
                if (_isInitialized)
                {
                    return;
                }

                _isInitialized = true;

                try
                {
                    _engineStatusPtr = NativeInterop.GetProfilerStatusPointer();
                }
                catch (Exception e)
                {
                    Log.Warning(e, "No profiler related feature(s) will be enabled. Failed to retrieve profiler status native pointer.");
                    _engineStatusPtr = IntPtr.Zero;
                }
            }
        }
        private void EnsureIsInitialized()
        {
            if (_traceContextPtr.IsValueCreated)
            {
                return;
            }

            try
            {
                _traceContextPtr.Value = NativeInterop.GetTraceContextNativePointer();
            }
            catch (Exception e)
            {
                Log.Warning(e, "Unable to get the tracing context pointer for the thread {ThreadID}", Environment.CurrentManagedThreadId.ToString());
                _traceContextPtr.Value = IntPtr.Zero;
            }
        }