mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-29 19:37:00 -05:00
Move 3rd party libraries to "vendored" directory
This commit is contained in:
parent
b5b9ea2083
commit
c04ad45093
434 changed files with 17 additions and 14 deletions
|
|
@ -1,52 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "mutex_debug.hpp"
|
||||
#else
|
||||
#include "mutex_ndebug.hpp"
|
||||
#endif
|
||||
|
||||
typedef pthread_mutex_t mutex_t;
|
||||
|
||||
// Simple mutex_t wrapper to provide RAII
|
||||
// Because macros are needed to get location in the code a lock is
|
||||
// called not making it std::mutex compatible.
|
||||
class Mutex
|
||||
{
|
||||
private:
|
||||
mutex_t _mutex;
|
||||
|
||||
public:
|
||||
Mutex()
|
||||
{
|
||||
mutex_init(_mutex);
|
||||
}
|
||||
|
||||
~Mutex()
|
||||
{
|
||||
mutex_destroy(_mutex);
|
||||
}
|
||||
|
||||
operator mutex_t&()
|
||||
{
|
||||
return _mutex;
|
||||
}
|
||||
};
|
||||
|
||||
class LockGuard
|
||||
{
|
||||
private:
|
||||
mutex_t &_mutex;
|
||||
|
||||
public:
|
||||
LockGuard(mutex_t &mutex_)
|
||||
: _mutex(mutex_)
|
||||
{
|
||||
mutex_lock(_mutex);
|
||||
}
|
||||
|
||||
~LockGuard()
|
||||
{
|
||||
mutex_unlock(_mutex);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue