port pobj to c99, add to build system

This commit is contained in:
Sears Russell 2008-10-01 20:02:09 +00:00
parent 545fe27019
commit 348783398a
4 changed files with 8 additions and 7 deletions

View file

@ -1 +1 @@
SUBDIRS(stasis libdfa 2pc timing apps)
SUBDIRS(stasis libdfa 2pc timing apps pobj)

1
src/pobj/CMakeLists.txt Normal file
View file

@ -0,0 +1 @@
ADD_LIBRARY(pobj xmem.c debug.c hash.c queue.c pobj.c)

View file

@ -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 *, ...);

View file

@ -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;