Skip to content

Commit

Permalink
Full sleep wait flex counter polling thread when POLL_COUNTER_STATUS …
Browse files Browse the repository at this point in the history
…is disable (sonic-net#462)

Signed-off-by: Wenda Ni <wenni@microsoft.com>
  • Loading branch information
wendani authored and lguohan committed Jun 4, 2019
1 parent e10fba8 commit d445b0e
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 77 deletions.
13 changes: 8 additions & 5 deletions syncd/syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2782,9 +2782,11 @@ void processFlexCounterGroupEvent(
{
SWSS_LOG_ENTER();

std::lock_guard<std::mutex> lock(g_mutex);
swss::KeyOpFieldsValuesTuple kco;
consumer.pop(kco);
{
std::lock_guard<std::mutex> lock(g_mutex);
consumer.pop(kco);
}

const auto &groupName = kfvKey(kco);
const auto &op = kfvOp(kco);
Expand Down Expand Up @@ -2860,10 +2862,11 @@ void processFlexCounterEvent(
{
SWSS_LOG_ENTER();

std::lock_guard<std::mutex> lock(g_mutex);

swss::KeyOpFieldsValuesTuple kco;
consumer.pop(kco);
{
std::lock_guard<std::mutex> lock(g_mutex);
consumer.pop(kco);
}

const auto &key = kfvKey(kco);
const auto &op = kfvOp(kco);
Expand Down
Loading

0 comments on commit d445b0e

Please sign in to comment.