From e98d3808478c09fb4058a53a7dc215d8fae1553f Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 3 Jun 2009 00:38:26 +0000 Subject: server-helpers: cleanup connection only if there are no active transports. - thanks to Ioannis Aslanidis for reporting. - breakup the server_connection_cleanup into smaller procedures. - do following operations in a single atomic operation. 1. conn->active_transports-- 2. collecting pointer to lock table and all fds if there are no active transports this will avoid any race conditions. Signed-off-by: Anand V. Avati --- xlators/protocol/server/src/server-protocol.h | 1 + 1 file changed, 1 insertion(+) (limited to 'xlators/protocol/server/src/server-protocol.h') diff --git a/xlators/protocol/server/src/server-protocol.h b/xlators/protocol/server/src/server-protocol.h index 1ea30cc6f66..dabe6927b85 100644 --- a/xlators/protocol/server/src/server-protocol.h +++ b/xlators/protocol/server/src/server-protocol.h @@ -63,6 +63,7 @@ struct _server_connection { struct list_head list; char *id; int ref; + int active_transports; pthread_mutex_t lock; char disconnected; fdtable_t *fdtable; -- cgit