From 762f7a4d7b3155254416b460c28a23c418ae59ed Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 2 Aug 2013 18:13:24 +0200 Subject: [SERVER] several improvements 1) Close uplink if local copy is complete 2) Fix memleak when closing uplink (recv buffer was not cleared) 3) Add configurable artificial delays for client and server connections --- src/server/locks.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/server/locks.h') diff --git a/src/server/locks.h b/src/server/locks.h index 5d4367b..43a3943 100644 --- a/src/server/locks.h +++ b/src/server/locks.h @@ -7,11 +7,13 @@ #define spin_init( lock, type ) debug_spin_init( #lock, __FILE__, __LINE__, lock, type) #define spin_lock( lock ) debug_spin_lock( #lock, __FILE__, __LINE__, lock) +#define spin_trylock( lock ) debug_spin_trylock( #lock, __FILE__, __LINE__, lock) #define spin_unlock( lock ) debug_spin_unlock( #lock, __FILE__, __LINE__, lock) #define spin_destroy( lock ) debug_spin_destroy( #lock, __FILE__, __LINE__, lock) int debug_spin_init(const char *name, const char *file, int line, pthread_spinlock_t *lock, int shared); int debug_spin_lock(const char *name, const char *file, int line, pthread_spinlock_t *lock); +int debug_spin_trylock(const char *name, const char *file, int line, pthread_spinlock_t *lock); int debug_spin_unlock(const char *name, const char *file, int line, pthread_spinlock_t *lock); int debug_spin_destroy(const char *name, const char *file, int line, pthread_spinlock_t *lock); @@ -21,6 +23,7 @@ void debug_dump_lock_stats(); #define spin_init( lock, type ) pthread_spin_init(lock, type) #define spin_lock( lock ) pthread_spin_lock(lock) +#define spin_trylock( lock ) pthread_spin_trylock(lock) #define spin_unlock( lock ) pthread_spin_unlock(lock) #define spin_destroy( lock ) pthread_spin_destroy(lock) -- cgit v1.2.3-55-g7522