private static void PrintState() { Console.WriteLine($"On thread {Thread.CurrentThread.ManagedThreadId} the state is {ThreadState.GetState<int>()}"); }