Class ThreadSafe

Synopsis

#include <src/easylogging++.h>

class ThreadSafe

Description

Base of thread safe class, this class is inheritable-only.

Inheritance

Decsendents: Storage, AsyncLogQueue, AbstractRegistry, TypedConfigurations, PerformanceTracker, AsyncDispatchWorker, Logger, VRegistry

Methods

ThreadSafe
~ThreadSafe
acquireLock
lock
releaseLock

Source

Lines 1006-1016 in src/easylogging++.h.

class ThreadSafe {
 public:
  virtual inline void acquireLock(void) ELPP_FINAL { m_mutex.lock(); }
  virtual inline void releaseLock(void) ELPP_FINAL { m_mutex.unlock(); }
  virtual inline base::threading::Mutex& lock(void) ELPP_FINAL { return m_mutex; }
 protected:
  ThreadSafe(void) {}
  virtual ~ThreadSafe(void) {}
 private:
  base::threading::Mutex m_mutex;
};





Add Discussion

Log in to comment