summaryrefslogtreecommitdiffstats
path: root/src/server/uplink.c
diff options
context:
space:
mode:
authorsr2013-07-17 12:10:01 +0200
committersr2013-07-17 12:10:01 +0200
commit3fd89450610679c6b777767632d2af5751773295 (patch)
treefdf63e0555bba9601f012ad5ce3eff631941bc4f /src/server/uplink.c
parentAdd debug-lock functions that will helpt to spot deadlocks etc. while developing (diff)
downloaddnbd3-3fd89450610679c6b777767632d2af5751773295.tar.gz
dnbd3-3fd89450610679c6b777767632d2af5751773295.tar.xz
dnbd3-3fd89450610679c6b777767632d2af5751773295.zip
Replace all pthread_spin_* calls with spin_*, so that all locking can be tracked and debugged
Fix compilation of kernel module
Diffstat (limited to 'src/server/uplink.c')
-rw-r--r--src/server/uplink.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/uplink.c b/src/server/uplink.c
index 797b287..07fe35b 100644
--- a/src/server/uplink.c
+++ b/src/server/uplink.c
@@ -1,4 +1,5 @@
#include "uplink.h"
+#include "locks.h"
#include <pthread.h>
#include <sys/socket.h>
#include <string.h>
@@ -17,7 +18,7 @@ int uplink_get_matching_alt_servers(dnbd3_host_t *host, dnbd3_server_entry_t *ou
int i, j;
int count = 0;
int distance[size];
- pthread_spin_lock( &_alts_lock );
+ spin_lock( &_alts_lock );
for (i = 0; i < _num_alts; ++i) {
if ( host->type != _alt_servers[i]->host.type ) continue; // Wrong address family
if ( count == 0 ) {
@@ -48,7 +49,7 @@ int uplink_get_matching_alt_servers(dnbd3_host_t *host, dnbd3_server_entry_t *ou
}
}
}
- pthread_spin_unlock( &_alts_lock );
+ spin_unlock( &_alts_lock );
return count;
}