From 0d53726a378d2af03ae0fd93be4d214044e976d9 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Wed, 1 Oct 2025 21:40:46 +0300 Subject: [PATCH] [#4140] addressed review comments --- src/hooks/dhcp/ping_check/ping_channel.cc | 3 ++- src/hooks/dhcp/ping_check/ping_context_store.h | 11 ----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/hooks/dhcp/ping_check/ping_channel.cc b/src/hooks/dhcp/ping_check/ping_channel.cc index 2e9e18f449..1e495fc958 100644 --- a/src/hooks/dhcp/ping_check/ping_channel.cc +++ b/src/hooks/dhcp/ping_check/ping_channel.cc @@ -320,7 +320,8 @@ PingChannel::sendNext() { // with this mutex locked. MultiThreadingLock send_lock(*send_mutex_); - // Fetch the next one to send (outside the mutex). + // Fetch the next one to send (outside the mutex) to avoid a possible + // deadlock with the mutex in the @ref PingCheckMgr::nextToSend callback. PingContextPtr context = ((next_to_send_cb_)()); if (!context) { // Nothing to send. diff --git a/src/hooks/dhcp/ping_check/ping_context_store.h b/src/hooks/dhcp/ping_check/ping_context_store.h index 3a7664bfca..a4f63a83b7 100644 --- a/src/hooks/dhcp/ping_check/ping_context_store.h +++ b/src/hooks/dhcp/ping_check/ping_context_store.h @@ -43,9 +43,6 @@ struct NextToSendIndexTag { }; /// @brief Tag for index by expiration time. struct ExpirationIndexTag { }; -/// @brief Tag for index by state. -struct StateIndexTag { }; - /// @brief A multi index container holding pointers to PingContexts. /// /// The contexts in the container may be accessed using different indexes: @@ -108,14 +105,6 @@ typedef boost::multi_index_container< boost::multi_index::const_mem_fun > - >, - - // Specification of the fifth index starts here. - // This index sorts contexts by State. - boost::multi_index::ordered_non_unique< - boost::multi_index::tag, - boost::multi_index::const_mem_fun > > > PingContextContainer; -- 2.47.3