private void EventLoop() { while (true) { if (_vm == null) { break; } var e = _vm.GetNextEvent(); lock (_queuedEvents) { _queuedEvents.Enqueue(e); } } }