Zero  0.1.0
Macros
w_pthread.h File Reference
#include <pthread.h>
#include <cstring>
#include <sstream>

Go to the source code of this file.

Macros

#define DO_PTHREAD_BARRIER(x)
 
#define DO_PTHREAD(x)
 
#define DO_PTHREAD_TIMED(x)
 

Macro Definition Documentation

§ DO_PTHREAD

#define DO_PTHREAD (   x)
Value:
{ int res = x; \
if(res) { \
std::stringstream S; \
S << "Unexpected result from " << #x << " " << res << " "; \
char buf[100]; \
void * xxrs; \
xxrs = (void *) strerror_r(res, &buf[0], sizeof(buf)); \
(void) xxrs; \
S << buf << ends; \
W_FATAL_MSG(fcINTERNAL, << S.str()); \
} \
}

§ DO_PTHREAD_BARRIER

#define DO_PTHREAD_BARRIER (   x)
Value:
{ int res = x; \
if(res && res != PTHREAD_BARRIER_SERIAL_THREAD) { \
std::stringstream S; \
S << "Unexpected result from " << #x << " " << res << " "; \
char buf[100]; \
(void) strerror_r(res, &buf[0], sizeof(buf)); \
S << buf << ends; \
W_FATAL_MSG(fcINTERNAL, << S.str()); \
} \
}

§ DO_PTHREAD_TIMED

#define DO_PTHREAD_TIMED (   x)
Value:
{ int res = x; \
if(res && res != ETIMEDOUT) { \
W_FATAL_MSG(fcINTERNAL, \
<<"Unexpected result from " << #x << " " << res); \
} \
}