X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Foverall.h;h=ff6f40873ab71ee3e87d8cee6c06c4f104074e44;hb=d57b2b3d5d3fcfba64139a7b7ea0a7a1502fb436;hp=caf062de7161598fa76e3ccc485ab790160c22a8;hpb=47821a9eac31a40a1ed8c9c53553ac45e44ca8f7;p=NeonServV5.git diff --git a/src/overall.h b/src/overall.h index caf062d..ff6f408 100644 --- a/src/overall.h +++ b/src/overall.h @@ -77,13 +77,21 @@ pthread_mutexattr_settype(&mutex_attr, type);\ pthread_mutex_init(&var, &mutex_attr); \ } +#ifdef ENABLE_MUTEX_DEBUG +#include "mutexDebug.h" +#define SYNCHRONIZE(var) xmutex(1, &var, __FILE__, __LINE__); pthread_mutex_lock(&var) +#define DESYNCHRONIZE(var) xmutex(0, &var, __FILE__, __LINE__); pthread_mutex_unlock(&var) +#else #define SYNCHRONIZE(var) pthread_mutex_lock(&var) -#define SET_SYNCHRONIZE(var) pthread_mutex_trylock(&var) #define DESYNCHRONIZE(var) pthread_mutex_unlock(&var) +#endif #else #define THREAD_MUTEX_INIT(var) #define SYNCHRONIZE(var) #define DESYNCHRONIZE(var) +#ifdef ENABLE_MUTEX_DEBUG +#undef ENABLE_MUTEX_DEBUG +#endif #endif #if __GNUC__ @@ -120,10 +128,6 @@ #include "memoryDebug.h" #endif -#define PID_FILE "neonserv.pid" -#define CONF_FILE "neonserv.conf" -#define LOG_FILE "neonserv.log" - #define SOCKET_SELECT_TIME 1 #define SOCKET_RECONNECT_TIME 20 @@ -163,8 +167,6 @@ #define timeval_is_bigger(x,y) ((x.tv_sec > y.tv_sec) || (x.tv_sec == y.tv_sec && x.tv_usec > y.tv_usec)) -#define perror(errmsg) (putlog(LOGLEVEL_ERROR, "ERROR (%s:%d) %s", __FILE__, __LINE__, errmsg)) - #define MODSTATE_RELOAD 0x01 #define MODSTATE_STARTSTOP 0x02 #define MODSTATE_REBIND 0x03