NoMutex

Files CCore/inc/task/NoMutex.h CCore/src/task/NoMutex.cpp

NoMutex is a class with the Mutex interface, but with empty methods. It is required sometimes to create a class, which can be used either in a single-threaded context or in a multi-threaded. This class can be implemented as a template, parametrized by a mutex type to avoid using a real mutex if it is not required.


class NoMutex : NoCopy
 {
  public:
  
   NoMutex() {}
   
   explicit NoMutex(TextLabel) {}
   
   ~NoMutex() {}
   
   void lock() {}
  
   void unlock() {}
   
   struct Lock : NoCopy
    {
     explicit Lock(NoMutex &) {}
    };
 };