mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-03 13:20:25 -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,64 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#ifndef PTHREAD_MUTEX_ADAPTIVE_NP
|
||||
# define PTHREAD_MUTEX_ADAPTIVE_NP PTHREAD_MUTEX_NORMAL
|
||||
#endif
|
||||
|
||||
|
||||
static
|
||||
inline
|
||||
void
|
||||
mutex_init(pthread_mutex_t &mutex_)
|
||||
{
|
||||
int rv;
|
||||
pthread_mutexattr_t attr;
|
||||
|
||||
pthread_mutexattr_init(&attr);
|
||||
pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_ADAPTIVE_NP);
|
||||
|
||||
rv = pthread_mutex_init(&mutex_,&attr);
|
||||
if(rv != 0)
|
||||
std::abort();
|
||||
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
}
|
||||
|
||||
static
|
||||
inline
|
||||
void
|
||||
mutex_lock(pthread_mutex_t &mutex_)
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = pthread_mutex_lock(&mutex_);
|
||||
if(rv != 0)
|
||||
std::abort();
|
||||
}
|
||||
|
||||
static
|
||||
inline
|
||||
void
|
||||
mutex_unlock(pthread_mutex_t &mutex_)
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = pthread_mutex_unlock(&mutex_);
|
||||
if(rv != 0)
|
||||
std::abort();
|
||||
}
|
||||
|
||||
static
|
||||
inline
|
||||
void
|
||||
mutex_destroy(pthread_mutex_t &mutex_)
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = pthread_mutex_destroy(&mutex_);
|
||||
if(rv != 0)
|
||||
std::abort();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue