summaryrefslogtreecommitdiffstats
path: root/src/server/locks.h
diff options
context:
space:
mode:
authorSimon Rettberg2013-08-02 18:13:24 +0200
committerSimon Rettberg2013-08-02 18:13:24 +0200
commit762f7a4d7b3155254416b460c28a23c418ae59ed (patch)
treefb904393252a9f5688d2327c8c04965edf6c505b /src/server/locks.h
parentfix0rs (diff)
downloaddnbd3-762f7a4d7b3155254416b460c28a23c418ae59ed.tar.gz
dnbd3-762f7a4d7b3155254416b460c28a23c418ae59ed.tar.xz
dnbd3-762f7a4d7b3155254416b460c28a23c418ae59ed.zip
[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
Diffstat (limited to 'src/server/locks.h')
-rw-r--r--src/server/locks.h3
1 files changed, 3 insertions, 0 deletions
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)