diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-01-08 15:20:23 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2018-01-08 15:20:23 +0100 |
commit | e78886f1b63bbe79a37897f559a179bebfef1882 (patch) | |
tree | dd6eaf434d3747207fe9f6c0b72d3dd7692ab472 /searchlib | |
parent | e68dd5f453440e7f4c7aeec795cba489da5079c3 (diff) |
Stick with a LockGuard.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/transactionlog/domain.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/searchlib/src/vespa/searchlib/transactionlog/domain.cpp b/searchlib/src/vespa/searchlib/transactionlog/domain.cpp index 44c7157d70e..88c2dd9ecc3 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/domain.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/domain.cpp @@ -5,6 +5,7 @@ #include <vespa/vespalib/util/closuretask.h> #include <vespa/fastos/file.h> #include <algorithm> +#include <thread> #include <vespa/log/log.h> LOG_SETUP(".transactionlog.domain"); @@ -18,6 +19,7 @@ using vespalib::Monitor; using vespalib::MonitorGuard; using search::common::FileHeaderContext; using std::runtime_error; +using namespace std::chrono_literals; namespace search::transactionlog { @@ -357,8 +359,8 @@ int Domain::closeSession(int sessionId) } } while (retval == 1) { - FastOS_Thread::Sleep(10); - MonitorGuard guard(_sessionLock); + std::this_thread::sleep_for(10ms); + LockGuard guard(_sessionLock); SessionList::iterator found = _sessions.find(sessionId); if (found != _sessions.end()) { if ( ! found->second->isVisitRunning()) { |