diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-02-22 11:11:22 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-02-22 11:11:22 +0000 |
commit | 5d3e5b451fe017ceb6a34b7dd2b1f15251423600 (patch) | |
tree | cf8fd6b63c4dbed356ebbd775a30c5be1199fc9a /searchcore/src | |
parent | 09d47cf99bf75fcf1ac956649c260767fd08ccce (diff) |
Assume all will go well, and undo if bad.
Diffstat (limited to 'searchcore/src')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp b/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp index 4e12ea97a0d..ed0e9ad79c5 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp @@ -169,12 +169,14 @@ void ProtonConfigFetcher::start(FastOS_ThreadPool & threadPool) { fetchConfigs(); + lock_guard guard(_mutex); + if (_running) return; + _running = true; if (threadPool.NewThread(this, nullptr) == nullptr) { + _running = false; throw vespalib::IllegalStateException( "Failed starting thread for proton config fetcher"); } - lock_guard guard(_mutex); - _running = true; } void |