/// <summary>
 /// Set the current thread.
 /// </summary>
 /// <param name="threadId">thread id</param>
 /// <exception cref="DiagnosticsException">invalid thread id</exception>
 public void SetCurrentThread(uint threadId) => SetCurrentThread(ThreadService?.GetThreadFromId(threadId));
 /// <summary>
 /// Returns the current thread.
 /// </summary>
 public virtual IThread GetCurrentThread() => _currentThread ??= ThreadService?.EnumerateThreads().FirstOrDefault();