ZeroErr
threadsafe.h File Reference
#include "zeroerr/internal/config.h"
#include <atomic>
#include <mutex>
Include dependency graph for threadsafe.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ZEROERR_MUTEX(x)   static std::mutex x;
 
#define ZEROERR_LOCK(x)   std::lock_guard<std::mutex> lock(x);
 
#define ZEROERR_ATOMIC(x)   std::atomic<x>
 
#define ZEROERR_LOAD(x)   x.load()
 

Macro Definition Documentation

◆ ZEROERR_ATOMIC

#define ZEROERR_ATOMIC (   x)    std::atomic<x>

◆ ZEROERR_LOAD

#define ZEROERR_LOAD (   x)    x.load()

◆ ZEROERR_LOCK

#define ZEROERR_LOCK (   x)    std::lock_guard<std::mutex> lock(x);

◆ ZEROERR_MUTEX

#define ZEROERR_MUTEX (   x)    static std::mutex x;