diff options
author | Simon Rettberg | 2014-06-16 19:24:17 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-06-16 19:24:17 +0200 |
commit | 49f9218d330f5842fe24bce79267bd2c5b239df3 (patch) | |
tree | 74e7b49e9c058145069ac4e2aa6de5d9f2cac3ce /src/server/locks.c | |
parent | [CLIENT] Debug argument handling in daemon mode (diff) | |
download | dnbd3-49f9218d330f5842fe24bce79267bd2c5b239df3.tar.gz dnbd3-49f9218d330f5842fe24bce79267bd2c5b239df3.tar.xz dnbd3-49f9218d330f5842fe24bce79267bd2c5b239df3.zip |
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...
Diffstat (limited to 'src/server/locks.c')
-rw-r--r-- | src/server/locks.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 } |