diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 619b4ba..964f01e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1 +1 @@ -SUBDIRS(stasis libdfa 2pc timing apps) +SUBDIRS(stasis libdfa 2pc timing apps pobj) diff --git a/src/pobj/CMakeLists.txt b/src/pobj/CMakeLists.txt new file mode 100644 index 0000000..ab70ea9 --- /dev/null +++ b/src/pobj/CMakeLists.txt @@ -0,0 +1 @@ +ADD_LIBRARY(pobj xmem.c debug.c hash.c queue.c pobj.c) diff --git a/src/pobj/debug.h b/src/pobj/debug.h index 16f8d11..c99cff9 100644 --- a/src/pobj/debug.h +++ b/src/pobj/debug.h @@ -9,8 +9,8 @@ #ifdef HAVE_DEBUG # ifdef HAVE_DEBUG_CONTEXTS -# define debug(format,...) debug_f_printf(__FUNCTION__, __LINE__, \ - format, ##__VA_ARGS__) +# define debug(...) debug_f_printf(__FUNCTION__, __LINE__, \ + ##__VA_ARGS__) # define debug_start() debug_f_start(__FUNCTION__) # define debug_end() debug_f_end() int debug_f_printf (const char *, const int, const char *, ...); diff --git a/src/pobj/pobj.c b/src/pobj/pobj.c index fc9b5fa..6d04a48 100644 --- a/src/pobj/pobj.c +++ b/src/pobj/pobj.c @@ -185,20 +185,20 @@ pobj_start (void) int pobj_end (void) { - void * active_xid; - void * active_nested; + long active_xid; + long active_nested; if (! g_is_init) return -1; - active_nested = pthread_getspecific (g_active_nested_key); + active_nested = (long) pthread_getspecific (g_active_nested_key); if (active_nested) { active_nested--; if (pthread_setspecific (g_active_nested_key, (void *) active_nested)) return -1; } else { - active_xid = pthread_getspecific (g_active_xid_key) - 1; + active_xid = ((long) pthread_getspecific (g_active_xid_key)) - 1; if (active_xid >= 0) { if (pthread_setspecific (g_active_xid_key, NULL)) return -1;