[icinga-checkins] icinga.org: icinga-core/mbrooks/cgis: idoutils: remove locking the dynamic buffer #1734

git at icinga.org git at icinga.org
Fri Jul 29 00:39:57 CEST 2011


Module: icinga-core
Branch: mbrooks/cgis
Commit: d62e674f7b019a5d3dd8105686770c75e2e12f12
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=d62e674f7b019a5d3dd8105686770c75e2e12f12

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Fri Jul 22 19:24:22 2011 +0200

idoutils: remove locking the dynamic buffer #1734

doesn't make sense without having a thread using it actually.

refs #1743

---

 module/idoutils/src/ido2db.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/module/idoutils/src/ido2db.c b/module/idoutils/src/ido2db.c
index 32e2bf3..1a9d173 100644
--- a/module/idoutils/src/ido2db.c
+++ b/module/idoutils/src/ido2db.c
@@ -1347,9 +1347,10 @@ int ido2db_handle_client_connection(int sd){
 		/* append data we just read to dynamic buffer */
 		buf[result]='\x0';
 		/* 2011-02-23 MF: lock dynamic buffer with a mutex when writing */
-		pthread_mutex_lock(&ido2db_dbuf_lock);
+		/* 2011-07-22 MF: redo it the old way, it may cause dead locks */
+		/* pthread_mutex_lock(&ido2db_dbuf_lock); */
 		ido_dbuf_strcat(&dbuf,buf);
-		pthread_mutex_unlock(&ido2db_dbuf_lock);
+		/* pthread_mutex_unlock(&ido2db_dbuf_lock); */
 
 		/* check for completed lines of input */
 		/* 2011-02-23 MF: only do that in a worker thread */
@@ -1456,8 +1457,6 @@ int ido2db_check_for_client_input(ido2db_idi *idi){
 	/* check if buffer full? bail out and tell main to disconnect the client! FIXME */
 	ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_check_for_client_input() dbuf.size=%lu\n", dbuf.used_size);
 
-	//pthread_mutex_lock(&ido2db_dbuf_lock);
-
 	//ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_check_for_client_input() ido2db_dbuf_lock start\n");
 
 #ifdef DEBUG_IDO2DB2
@@ -1499,8 +1498,6 @@ int ido2db_check_for_client_input(ido2db_idi *idi){
 		}
 	}
 
-	//pthread_mutex_unlock(&ido2db_dbuf_lock);
-
 	//ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_check_for_client_input() ido2db_dbuf_lock end\n");
 
 	//ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_check_for_client_input() end\n");





More information about the icinga-checkins mailing list