Skip to content

Commit 5ab44b0

Browse files
committed
Unlock mutex before throwing exception
1 parent aca253a commit 5ab44b0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

common/selectabletimer.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ void SelectableTimer::start()
4444
int rc = timerfd_settime(m_tfd, 0, &m_interval, NULL);
4545
if (rc == -1)
4646
{
47+
m_mutex.unlock();
4748
SWSS_LOG_THROW("failed to set timerfd, errno: %s", strerror(errno));
4849
}
4950
else
@@ -63,6 +64,7 @@ void SelectableTimer::stop()
6364
int rc = timerfd_settime(m_tfd, 0, &m_zero, NULL);
6465
if (rc == -1)
6566
{
67+
m_mutex.unlock();
6668
SWSS_LOG_THROW("failed to set timerfd to zero, errno: %s", strerror(errno));
6769
}
6870
else

0 commit comments

Comments
 (0)