From ecc210f99ae011557aa0ccdf1b8f9b4bccbf11fd Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Sat, 18 Jun 2016 02:20:29 -0700 Subject: [PATCH] Rename Notifier::m_handlerMutex to Notifier::m_notifyMutex (#105) A month ago, we discussed renaming this mutex to better reflect its current use, and this commit does that. The inline comment was also updated. --- wpilibc/athena/include/Notifier.h | 4 ++-- wpilibc/athena/src/Notifier.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wpilibc/athena/include/Notifier.h b/wpilibc/athena/include/Notifier.h index 1f8adff23c..249a4ef9c2 100644 --- a/wpilibc/athena/include/Notifier.h +++ b/wpilibc/athena/include/Notifier.h @@ -53,6 +53,6 @@ class Notifier : public ErrorBase { // true if this is a periodic event bool m_periodic = false; - // held by interrupt manager task while handler call is in progress - priority_mutex m_handlerMutex; + // held HAL notifier while Notifier::Notify() call is in progress + priority_mutex m_notifyMutex; }; diff --git a/wpilibc/athena/src/Notifier.cpp b/wpilibc/athena/src/Notifier.cpp index ebd384dc27..9611cccc33 100644 --- a/wpilibc/athena/src/Notifier.cpp +++ b/wpilibc/athena/src/Notifier.cpp @@ -39,7 +39,7 @@ Notifier::~Notifier() { /* Acquire the mutex; this makes certain that the handler is not being * executed by the interrupt manager. */ - std::lock_guard lock(m_handlerMutex); + std::lock_guard lock(m_notifyMutex); } /** @@ -66,11 +66,11 @@ void Notifier::Notify(uint64_t currentTimeInt, void* param) { auto handler = notifier->m_handler; - notifier->m_handlerMutex.lock(); + notifier->m_notifyMutex.lock(); notifier->m_processMutex.unlock(); if (handler) handler(); - notifier->m_handlerMutex.unlock(); + notifier->m_notifyMutex.unlock(); } /** @@ -122,5 +122,5 @@ void Notifier::Stop() { // Wait for a currently executing handler to complete before returning from // Stop() - std::lock_guard sync(m_handlerMutex); + std::lock_guard sync(m_notifyMutex); }