private void StartNewThread(ManualResetEventSlim threadStartedEvent, ThreadPriority priority) { var thread = new Thread(ThreadProc); thread.IsBackground = true; thread.Priority = priority; thread.Start(threadStartedEvent); threadStartedEvent.WaitAndReset(); }