[asterisk-commits] dhubbard: branch group/taskprocessors r111495 - in /team/group/taskprocessors...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 27 15:43:57 CDT 2008


Author: dhubbard
Date: Thu Mar 27 15:43:57 2008
New Revision: 111495

URL: http://svn.digium.com/view/asterisk?view=rev&rev=111495
Log:
removed unnecessary lock (thanks file) and inch towards coding guidelines (thanks Mark)

Modified:
    team/group/taskprocessors/channels/chan_sip.c
    team/group/taskprocessors/main/taskprocessor.c

Modified: team/group/taskprocessors/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/taskprocessors/channels/chan_sip.c?view=diff&rev=111495&r1=111494&r2=111495
==============================================================================
--- team/group/taskprocessors/channels/chan_sip.c (original)
+++ team/group/taskprocessors/channels/chan_sip.c Thu Mar 27 15:43:57 2008
@@ -18109,9 +18109,9 @@
 		taskdata->req.data->str[res] = '\0';
 	taskdata->req.len = res;
 
-	taskdata->req.socket.fd 	= sipsock;
+	taskdata->req.socket.fd = sipsock;
 	taskdata->req.socket.type = SIP_TRANSPORT_UDP;
-	taskdata->req.socket.ser	= NULL;
+	taskdata->req.socket.ser = NULL;
 	taskdata->req.socket.port = bindaddr.sin_port;
 	taskdata->req.socket.lock = NULL;
 

Modified: team/group/taskprocessors/main/taskprocessor.c
URL: http://svn.digium.com/view/asterisk/team/group/taskprocessors/main/taskprocessor.c?view=diff&rev=111495&r1=111494&r2=111495
==============================================================================
--- team/group/taskprocessors/main/taskprocessor.c (original)
+++ team/group/taskprocessors/main/taskprocessor.c Thu Mar 27 15:43:57 2008
@@ -370,9 +370,7 @@
 		ao2_ref(p, -1);
 		return NULL;
 	}
-	ast_mutex_lock(&p->_taskprocessor_lock);
 	if (p->_poll_thread == pthread_self()) {
-		ast_mutex_unlock(&p->_taskprocessor_lock);
 		ast_log(LOG_DEBUG, "cannot kill myself.\n");
 		ao2_ref(p, -1);
 		return NULL;
@@ -388,13 +386,11 @@
 			rc = ast_pthread_create(&p->_poll_thread, NULL, tps_default_processor_function, p);
 		}
 		if (rc < 0) {
-			ast_mutex_unlock(&p->_taskprocessor_lock);
 			ast_log(LOG_ERROR, "failed to create thread \'%s\'.\n", p->_name);
 			ao2_ref(p, -1);
 			return NULL;
 		}
 	}
-	ast_mutex_unlock(&p->_taskprocessor_lock);
 	return p;
 }
 	
@@ -495,7 +491,7 @@
 		AST_LIST_LOCK(&tps->_queue);
 	}
 	AST_LIST_INSERT_TAIL(&tps->_queue, t, list);
-	tps->_queue_size+=1;
+	tps->_queue_size += 1;
 	ast_mutex_unlock(&tps->_taskprocessor_lock);
 	AST_LIST_UNLOCK(&tps->_queue);
 	return 0;
@@ -523,7 +519,7 @@
 	}
 	if (!AST_LIST_EMPTY(&tps->_queue)) {
 		t = AST_LIST_REMOVE_HEAD(&tps->_queue, list);
-		tps->_queue_size-=1;
+		tps->_queue_size -= 1;
 	}
 	ast_mutex_unlock(&tps->_taskprocessor_lock);
 	AST_LIST_UNLOCK(&tps->_queue);




More information about the asterisk-commits mailing list