ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/util.h
(Generate patch)

Comparing deliantra/server/include/util.h (file contents):
Revision 1.67 by root, Fri Apr 11 21:09:53 2008 UTC vs.
Revision 1.69 by root, Fri Apr 18 23:43:59 2008 UTC

65void *g_slice_alloc0 (unsigned long size); 65void *g_slice_alloc0 (unsigned long size);
66void g_slice_free1 (unsigned long size, void *ptr); 66void g_slice_free1 (unsigned long size, void *ptr);
67#elif PREFER_MALLOC 67#elif PREFER_MALLOC
68# define g_slice_alloc0(s) calloc (1, (s)) 68# define g_slice_alloc0(s) calloc (1, (s))
69# define g_slice_alloc(s) malloc ((s)) 69# define g_slice_alloc(s) malloc ((s))
70# define g_slice_free1(s,p) free ((s)) 70# define g_slice_free1(s,p) free ((p))
71#endif 71#endif
72 72
73// use C0X decltype for auto declarations until ISO C++ sanctifies them (if ever) 73// use C0X decltype for auto declarations until ISO C++ sanctifies them (if ever)
74#define auto(var,expr) decltype(expr) var = (expr) 74#define auto(var,expr) decltype(expr) var = (expr)
75 75
606#else 606#else
607 #define SMUTEX_INITIALISER PTHREAD_MUTEX_INITIALIZER 607 #define SMUTEX_INITIALISER PTHREAD_MUTEX_INITIALIZER
608#endif 608#endif
609 609
610#define SMUTEX(name) smutex name = SMUTEX_INITIALISER 610#define SMUTEX(name) smutex name = SMUTEX_INITIALISER
611#define SMUTEX_LOCK(name) pthread_mutex_lock (&(name)) 611#define SMUTEX_LOCK(name) pthread_mutex_lock (&(name))
612#define SMUTEX_UNLOCK(name) pthread_mutex_unlock (&(name)) 612#define SMUTEX_UNLOCK(name) pthread_mutex_unlock (&(name))
613 613
614typedef pthread_cond_t scond;
615
616#define SCOND(name) scond name = PTHREAD_COND_INITIALIZER
617#define SCOND_SIGNAL(name) pthread_cond_signal (&(name))
618#define SCOND_BROADCAST(name) pthread_cond_broadcast (&(name))
619#define SCOND_WAIT(name,mutex) pthread_cond_wait (&(name), &(mutex))
620
614#endif 621#endif
615 622

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines