diff options
author | sr | 2013-07-17 12:10:01 +0200 |
---|---|---|
committer | sr | 2013-07-17 12:10:01 +0200 |
commit | 3fd89450610679c6b777767632d2af5751773295 (patch) | |
tree | fdf63e0555bba9601f012ad5ce3eff631941bc4f /src/server/uplink.c | |
parent | Add debug-lock functions that will helpt to spot deadlocks etc. while developing (diff) | |
download | dnbd3-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.c | 5 |
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; } |