@@ -59,8 +59,6 @@ class MutexBase {
5959 static void * operator new [](size_t , void * ptr) { return ptr; }
6060 static void * operator new (size_t ) = delete ;
6161 static void * operator new [](size_t ) = delete ;
62- static void operator delete (void *) = delete ;
63- static void operator delete[] (void *) = delete ;
6462
6563 /* *
6664 * Mutex.hpp
@@ -159,7 +157,19 @@ class MutexBase {
159157
160158 private:
161159 MutexBase () = default ;
162- ~MutexBase () = default ;
160+
161+ /* *
162+ * Mutex.hpp
163+ *
164+ * @brief Destroy the MutexBase object by calling <tt>void vSemaphoreDelete(
165+ * SemaphoreHandle_t xSemaphore )</tt>
166+ *
167+ * @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
168+ *
169+ * @note Do not delete a mutex that has tasks blocked on it (tasks that are in
170+ * the Blocked state waiting for the mutex to become available).
171+ */
172+ ~MutexBase () { vSemaphoreDelete (this ->handle ); }
163173
164174 MutexBase (MutexBase&&) noexcept = default ;
165175 MutexBase& operator =(MutexBase&&) noexcept = default ;
@@ -194,8 +204,6 @@ class RecursiveMutexBase : public MutexBase {
194204 static void * operator new [](size_t , void *);
195205 static void * operator new (size_t ) = delete ;
196206 static void * operator new [](size_t ) = delete ;
197- static void operator delete (void *) = delete ;
198- static void operator delete[] (void *) = delete ;
199207
200208 /* *
201209 * Mutex.hpp
@@ -298,19 +306,7 @@ class Mutex : public MutexBase {
298306 * @include Mutex/mutex.cpp
299307 */
300308 Mutex () { this ->handle = xSemaphoreCreateMutex (); }
301-
302- /* *
303- * Mutex.hpp
304- *
305- * @brief Destroy the Mutex object by calling <tt>void vSemaphoreDelete(
306- * SemaphoreHandle_t xSemaphore )</tt>
307- *
308- * @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
309- *
310- * @note Do not delete a mutex that has tasks blocked on it (tasks that are in
311- * the Blocked state waiting for the mutex to become available).
312- */
313- ~Mutex () { vSemaphoreDelete (this ->handle ); }
309+ ~Mutex () = default ;
314310
315311 Mutex (const Mutex&) = delete ;
316312 Mutex& operator =(const Mutex&) = delete ;
@@ -363,19 +359,7 @@ class RecursiveMutex : public RecursiveMutexBase {
363359 * @include Mutex/recursiveMutex.cpp
364360 */
365361 RecursiveMutex () { this ->handle = xSemaphoreCreateRecursiveMutex (); }
366-
367- /* *
368- * Mutex.hpp
369- *
370- * @brief Destroy the RecursiveMutex object by calling <tt>void
371- * vSemaphoreDelete( SemaphoreHandle_t xSemaphore )</tt>
372- *
373- * @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
374- *
375- * @note Do not delete a mutex that has tasks blocked on it (tasks that are in
376- * the Blocked state waiting for the mutex to become available).
377- */
378- ~RecursiveMutex () { vSemaphoreDelete (this ->handle ); }
362+ ~RecursiveMutex () = default ;
379363
380364 RecursiveMutex (const RecursiveMutex&) = delete ;
381365 RecursiveMutex& operator =(const RecursiveMutex&) = delete ;
0 commit comments