public void Execute() { lock (_lock) { if (_shuttingDown) { return; } Task <bool> result = _bot.Execute(); result.Wait(); } }