Microsoft.Scripting.Debugging.CompilerServices.DebugContext.GetCurrentThread C# (CSharp) Method

GetCurrentThread() private method

private GetCurrentThread ( ) : DebugThread
return DebugThread
        internal DebugThread GetCurrentThread() {
            DebugThread thread = _cachedThread;
            if (thread == null || thread.ManagedThread != Thread.CurrentThread) {
                thread = _thread.Value;
                if (thread == null) {
                    thread = _threadFactory.CreateDebugThread(this);
                    _thread.Value = thread;
                }
                Interlocked.Exchange(ref _cachedThread, thread);
            }

            return thread;
        }
    }