port pobj to c99, add to build system
This commit is contained in:
parent
545fe27019
commit
348783398a
4 changed files with 8 additions and 7 deletions
|
@ -1 +1 @@
|
||||||
SUBDIRS(stasis libdfa 2pc timing apps)
|
SUBDIRS(stasis libdfa 2pc timing apps pobj)
|
||||||
|
|
1
src/pobj/CMakeLists.txt
Normal file
1
src/pobj/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ADD_LIBRARY(pobj xmem.c debug.c hash.c queue.c pobj.c)
|
|
@ -9,8 +9,8 @@
|
||||||
|
|
||||||
#ifdef HAVE_DEBUG
|
#ifdef HAVE_DEBUG
|
||||||
# ifdef HAVE_DEBUG_CONTEXTS
|
# ifdef HAVE_DEBUG_CONTEXTS
|
||||||
# define debug(format,...) debug_f_printf(__FUNCTION__, __LINE__, \
|
# define debug(...) debug_f_printf(__FUNCTION__, __LINE__, \
|
||||||
format, ##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
# define debug_start() debug_f_start(__FUNCTION__)
|
# define debug_start() debug_f_start(__FUNCTION__)
|
||||||
# define debug_end() debug_f_end()
|
# define debug_end() debug_f_end()
|
||||||
int debug_f_printf (const char *, const int, const char *, ...);
|
int debug_f_printf (const char *, const int, const char *, ...);
|
||||||
|
|
|
@ -185,20 +185,20 @@ pobj_start (void)
|
||||||
int
|
int
|
||||||
pobj_end (void)
|
pobj_end (void)
|
||||||
{
|
{
|
||||||
void * active_xid;
|
long active_xid;
|
||||||
void * active_nested;
|
long active_nested;
|
||||||
|
|
||||||
if (! g_is_init)
|
if (! g_is_init)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
active_nested = pthread_getspecific (g_active_nested_key);
|
active_nested = (long) pthread_getspecific (g_active_nested_key);
|
||||||
if (active_nested) {
|
if (active_nested) {
|
||||||
active_nested--;
|
active_nested--;
|
||||||
if (pthread_setspecific (g_active_nested_key, (void *) active_nested))
|
if (pthread_setspecific (g_active_nested_key, (void *) active_nested))
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else {
|
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 (active_xid >= 0) {
|
||||||
if (pthread_setspecific (g_active_xid_key, NULL))
|
if (pthread_setspecific (g_active_xid_key, NULL))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue