diff options
Diffstat (limited to 'src/mongo/db/concurrency/d_concurrency_test.cpp')
-rw-r--r-- | src/mongo/db/concurrency/d_concurrency_test.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/concurrency/d_concurrency_test.cpp b/src/mongo/db/concurrency/d_concurrency_test.cpp index 9c1e131fdf6..9b359b9b6c4 100644 --- a/src/mongo/db/concurrency/d_concurrency_test.cpp +++ b/src/mongo/db/concurrency/d_concurrency_test.cpp @@ -70,18 +70,18 @@ const auto kMaxClockJitterMillis = Milliseconds(0); class UseGlobalThrottling { public: explicit UseGlobalThrottling(OperationContext* opCtx, int numTickets) : _opCtx(opCtx) { - _holder = std::make_unique<SemaphoreTicketHolder>(numTickets); - _opCtx->lockState()->setGlobalThrottling(_holder.get(), _holder.get()); + auto lockManager = LockManager::get(_opCtx); + lockManager->setTicketHolders(std::make_unique<SemaphoreTicketHolder>(numTickets), + std::make_unique<SemaphoreTicketHolder>(numTickets)); } ~UseGlobalThrottling() noexcept(false) { // Reset the global setting as we're about to destroy the ticket holder. - _opCtx->lockState()->setGlobalThrottling(nullptr, nullptr); - ASSERT_EQ(_holder->used(), 0); + auto lockManager = LockManager::get(_opCtx); + lockManager->setTicketHolders(nullptr, nullptr); } private: OperationContext* _opCtx; - std::unique_ptr<TicketHolder> _holder; }; |