LCOV - code coverage report
Current view: top level - src/AH/Containers - Mutex.hpp (source / functions) Hit Total Coverage
Test: e224b347cd670555e44f06608ac41bd1ace9d9d8 Lines: 2 2 100.0 %
Date: 2020-09-08 17:44:46 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : /// Mutex that doesn't lock anything, used on single-core systems.
       4             : struct EmptyMutex {
       5             :     void lock() { /* nothing */ }
       6             :     void unlock() { /* nothing */ }
       7             : };
       8             : 
       9             : /// Lock guard that doesn't lock it's mutex, used on single-core systems.
      10             : template <class Mutex>
      11             : struct EmptyLockGuard {
      12         490 :     EmptyLockGuard(Mutex &) { /* nothing */ }
      13         490 :     ~EmptyLockGuard() { /* nothing */ }
      14             : };
      15             : 
      16             : #if defined(ESP32) || !defined(ARDUINO)
      17             : 
      18             : #include <mutex>
      19             : 
      20             : using DefaultMutEx = std::mutex;
      21             : template <class Mutex>
      22             : using DefaultLockGuard = std::lock_guard<Mutex>;
      23             : 
      24             : #else
      25             : 
      26             : using DefaultMutEx = EmptyMutex;
      27             : template <class Mutex>
      28             : using DefaultLockGuard = EmptyLockGuard<Mutex>;
      29             : 
      30             : #endif

Generated by: LCOV version 1.14-6-g40580cd