From 49f9218d330f5842fe24bce79267bd2c5b239df3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 16 Jun 2014 19:24:17 +0200 Subject: Improve uplink handling, add code to debug thread creation/destruction, change stupid convention of freeDiskSpace returning 0 on error, which is ambiguous to the disk simply being full... --- src/server/locks.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/server/locks.c') diff --git a/src/server/locks.c b/src/server/locks.c index 72e6069..d93be40 100644 --- a/src/server/locks.c +++ b/src/server/locks.c @@ -41,6 +41,8 @@ typedef struct } debug_thread_t; +int debugThreadCount = 0; + static debug_lock_t locks[MAXLOCKS]; static debug_thread_t threads[MAXTHREADS]; static int init_done = 0; @@ -284,7 +286,7 @@ static void *debug_thread_watchdog(void *something) void debug_locks_start_watchdog() { #ifdef _DEBUG - if ( 0 != pthread_create( &watchdog, NULL, &debug_thread_watchdog, (void *)NULL ) ) { + if ( 0 != thread_create( &watchdog, NULL, &debug_thread_watchdog, (void *)NULL ) ) { memlogf( "[ERROR] Could not start debug-lock watchdog." ); return; } @@ -298,6 +300,6 @@ void debug_locks_stop_watchdog() printf( "Killing debug watchdog...\n" ); pthread_spin_lock( &initdestory ); pthread_spin_unlock( &initdestory ); - pthread_join( watchdog, NULL ); + thread_join( watchdog, NULL ); #endif } -- cgit v1.2.3-55-g7522