summaryrefslogtreecommitdiffstats
path: root/src/server/locks.c
diff options
context:
space:
mode:
authorSimon Rettberg2015-01-02 15:06:58 +0100
committerSimon Rettberg2015-01-02 15:06:58 +0100
commit35ae7af4c8f541785699ad7ca1ad64d2413a88ec (patch)
tree53e8354e089b5cc938eafe7f1a5e04114b5484e8 /src/server/locks.c
parent[SERVER] Use stdbool.h for booleans; minor refactoring of variable and functi... (diff)
downloaddnbd3-35ae7af4c8f541785699ad7ca1ad64d2413a88ec.tar.gz
dnbd3-35ae7af4c8f541785699ad7ca1ad64d2413a88ec.tar.xz
dnbd3-35ae7af4c8f541785699ad7ca1ad64d2413a88ec.zip
[SERVER] Dead code removal, minor performance tweaks, refactoring, etc.
Diffstat (limited to 'src/server/locks.c')
-rw-r--r--src/server/locks.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/locks.c b/src/server/locks.c
index 48f67a9..d779e6f 100644
--- a/src/server/locks.c
+++ b/src/server/locks.c
@@ -66,7 +66,7 @@ int debug_spin_init(const char *name, const char *file, int line, pthread_spinlo
pthread_spin_lock( &initdestory );
for (int i = 0; i < MAXLOCKS; ++i) {
if ( locks[i].lock == lock ) {
- printf( "[ERROR] Lock %p (%s) already initialized (%s:%d)\n", lock, name, file, line );
+ printf( "[ERROR] Lock %p (%s) already initialized (%s:%d)\n", (void*)lock, name, file, line );
exit( 4 );
}
if ( first == -1 && locks[i].lock == NULL ) first = i;
@@ -97,7 +97,7 @@ int debug_spin_lock(const char *name, const char *file, int line, pthread_spinlo
}
pthread_spin_unlock( &initdestory );
if ( l == NULL ) {
- printf( "[ERROR] Tried to lock uninitialized lock %p (%s) at %s:%d\n", lock, name, file, line );
+ printf( "[ERROR] Tried to lock uninitialized lock %p (%s) at %s:%d\n", (void*)lock, name, file, line );
debug_dump_lock_stats();
exit( 4 );
}
@@ -119,7 +119,7 @@ int debug_spin_lock(const char *name, const char *file, int line, pthread_spinlo
t->time = 0;
pthread_spin_unlock( &initdestory );
if ( l->locked ) {
- printf( "[ERROR] Lock sanity check: lock %p (%s) already locked at %s:%d\n", lock, name, file, line );
+ printf( "[ERROR] Lock sanity check: lock %p (%s) already locked at %s:%d\n", (void*)lock, name, file, line );
exit( 4 );
}
l->locked = 1;
@@ -144,7 +144,7 @@ int debug_spin_trylock(const char *name, const char *file, int line, pthread_spi
}
pthread_spin_unlock( &initdestory );
if ( l == NULL ) {
- printf( "[ERROR] Tried to lock uninitialized lock %p (%s) at %s:%d\n", lock, name, file, line );
+ printf( "[ERROR] Tried to lock uninitialized lock %p (%s) at %s:%d\n", (void*)lock, name, file, line );
debug_dump_lock_stats();
exit( 4 );
}
@@ -167,7 +167,7 @@ int debug_spin_trylock(const char *name, const char *file, int line, pthread_spi
pthread_spin_unlock( &initdestory );
if ( retval == 0 ) {
if ( l->locked ) {
- printf( "[ERROR] Lock sanity check: lock %p (%s) already locked at %s:%d\n", lock, name, file, line );
+ printf( "[ERROR] Lock sanity check: lock %p (%s) already locked at %s:%d\n", (void*)lock, name, file, line );
exit( 4 );
}
l->locked = 1;
@@ -193,11 +193,11 @@ int debug_spin_unlock(const char *name, const char *file, int line, pthread_spin
}
pthread_spin_unlock( &initdestory );
if ( l == NULL ) {
- printf( "[ERROR] Tried to unlock uninitialized lock %p (%s) at %s:%d\n", lock, name, file, line );
+ printf( "[ERROR] Tried to unlock uninitialized lock %p (%s) at %s:%d\n", (void*)lock, name, file, line );
exit( 4 );
}
if ( !l->locked ) {
- printf( "[ERROR] Unlock sanity check: lock %p (%s) not locked at %s:%d\n", lock, name, file, line );
+ printf( "[ERROR] Unlock sanity check: lock %p (%s) not locked at %s:%d\n", (void*)lock, name, file, line );
exit( 4 );
}
l->locked = 0;
@@ -214,7 +214,7 @@ int debug_spin_destroy(const char *name, const char *file, int line, pthread_spi
for (int i = 0; i < MAXLOCKS; ++i) {
if ( locks[i].lock == lock ) {
if ( locks[i].locked ) {
- printf( "[ERROR] Tried to destroy lock %p (%s) at %s:%d when it is still locked\n", lock, name, file, line );
+ printf( "[ERROR] Tried to destroy lock %p (%s) at %s:%d when it is still locked\n", (void*)lock, name, file, line );
exit( 4 );
}
locks[i].lock = NULL;
@@ -223,7 +223,7 @@ int debug_spin_destroy(const char *name, const char *file, int line, pthread_spi
return pthread_spin_destroy( lock );
}
}
- printf( "[ERROR] Tried to destroy non-existent lock %p (%s) at %s:%d\n", lock, name, file, line );
+ printf( "[ERROR] Tried to destroy non-existent lock %p (%s) at %s:%d\n", (void*)lock, name, file, line );
exit( 4 );
}