private void StartInputActionThread() { InputActionsThread?.Abort(); InputActionsThread = new Thread(() => { while (true) { if (InputActions.TryDequeue(out var action)) { action(); } Thread.Sleep(1); } }); InputActionsThread.SetApartmentState(ApartmentState.STA); InputActionsThread.Start(); }
private void StartInputActionThread() { InputActionsThread?.Abort(); InputActionsThread = new Thread(() => { while (!ShutdownStarted && !Environment.HasShutdownStarted) { if (InputActions.TryDequeue(out var action)) { action(); } Thread.Sleep(1); } }); InputActionsThread.SetApartmentState(ApartmentState.STA); InputActionsThread.Start(); }