[svn-commits] dhubbard: branch group/taskprocessors r114933 - in /team/group/taskprocessors...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu May 1 12:58:21 CDT 2008


Author: dhubbard
Date: Thu May  1 12:58:20 2008
New Revision: 114933

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114933
Log:
move ast_tps_init signature to _private; remove 3rd argument from ast_task_alloc

Modified:
    team/group/taskprocessors/apps/app_queue.c
    team/group/taskprocessors/apps/app_voicemail.c
    team/group/taskprocessors/channels/chan_sip.c
    team/group/taskprocessors/include/asterisk/_private.h
    team/group/taskprocessors/include/asterisk/taskprocessor.h
    team/group/taskprocessors/main/pbx.c
    team/group/taskprocessors/main/taskprocessor.c

Modified: team/group/taskprocessors/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/taskprocessors/apps/app_queue.c?view=diff&rev=114933&r1=114932&r2=114933
==============================================================================
--- team/group/taskprocessors/apps/app_queue.c (original)
+++ team/group/taskprocessors/apps/app_queue.c Thu May  1 12:58:20 2008
@@ -808,7 +808,7 @@
 	}
 	sc->state = state;
 	strcpy(sc->dev, device);
-	if (!(task = ast_task_alloc(handle_statechange, sc, "app_queue-device_state_cb"))) {
+	if (!(task = ast_task_alloc(handle_statechange, sc))) {
 		ast_log(LOG_WARNING, "failed to allocate a task for a device state change notification\n");
 	} else if (ast_taskprocessor_push(taskprocessor, task) < 0) {
 		ast_log(LOG_WARNING, "failed to push a device state change to the app_queue taskprocessor!!\n");

Modified: team/group/taskprocessors/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/group/taskprocessors/apps/app_voicemail.c?view=diff&rev=114933&r1=114932&r2=114933
==============================================================================
--- team/group/taskprocessors/apps/app_voicemail.c (original)
+++ team/group/taskprocessors/apps/app_voicemail.c Thu May  1 12:58:20 2008
@@ -8763,7 +8763,7 @@
 	}
 	u = ast_event_get_ie_uint(event, AST_EVENT_IE_UNIQUEID);
 	*uniqueid = u;
-	if (!(t = ast_task_alloc(handle_unsubscribe, uniqueid, "app_voicemail, mwi_unsub_event_cb"))) {
+	if (!(t = ast_task_alloc(handle_unsubscribe, uniqueid))) {
 		ast_log(LOG_WARNING, "failed to allocate a task for a mwi unsubcribe event\n");
 	} else if (ast_taskprocessor_push(taskprocessor, t) < 0) {
 		ast_log(LOG_ERROR, "failed to push a voicemail mwi unsubscribe task to taskprocessor\n");
@@ -8789,7 +8789,7 @@
 	mwist->context = ast_event_get_ie_str(event, AST_EVENT_IE_CONTEXT);
 	mwist->uniqueid = ast_event_get_ie_uint(event, AST_EVENT_IE_UNIQUEID);
 	
-	if (!(t = ast_task_alloc(handle_subscribe, mwist, "app_voicemail, mwi_sub_event_cb"))) {
+	if (!(t = ast_task_alloc(handle_subscribe, mwist))) {
 		ast_log(LOG_WARNING, "failed to allocate a task for a mwi subscribe event\n");
 	} else if (ast_taskprocessor_push(taskprocessor, t) < 0) {
 		ast_log(LOG_ERROR, "failed to push a voicemail mwi subscribe task to taskprocessor\n");

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=114933&r1=114932&r2=114933
==============================================================================
--- team/group/taskprocessors/channels/chan_sip.c (original)
+++ team/group/taskprocessors/channels/chan_sip.c Thu May  1 12:58:20 2008
@@ -19150,7 +19150,7 @@
 	taskdata->req.socket.port = bindaddr.sin_port;
 	taskdata->req.socket.lock = NULL;
 
-	if (!(task = ast_task_alloc(handle_request_do, taskdata, "sipsock_read"))) {
+	if (!(task = ast_task_alloc(handle_request_do, taskdata))) {
 		ast_log(LOG_WARNING, "failed to allocate a task for SIP message\n");
 	} else if (ast_taskprocessor_push(taskprocessor, task) < 0) {
 		ast_log(LOG_WARNING, "failed to push a SIP message to taskprocessor\n");

Modified: team/group/taskprocessors/include/asterisk/_private.h
URL: http://svn.digium.com/view/asterisk/team/group/taskprocessors/include/asterisk/_private.h?view=diff&rev=114933&r1=114932&r2=114933
==============================================================================
--- team/group/taskprocessors/include/asterisk/_private.h (original)
+++ team/group/taskprocessors/include/asterisk/_private.h Thu May  1 12:58:20 2008
@@ -36,6 +36,7 @@
 void ast_autoservice_init(void);	/*!< Provided by autoservice.c */
 int ast_http_init(void);		/*!< Provided by http.c */
 int ast_http_reload(void);		/*!< Provided by http.c */
+int ast_tps_init(void);			/*!< Provided by taskprocessor.c */
 
 /*!
  * \brief Reload asterisk modules.

Modified: team/group/taskprocessors/include/asterisk/taskprocessor.h
URL: http://svn.digium.com/view/asterisk/team/group/taskprocessors/include/asterisk/taskprocessor.h?view=diff&rev=114933&r1=114932&r2=114933
==============================================================================
--- team/group/taskprocessors/include/asterisk/taskprocessor.h (original)
+++ team/group/taskprocessors/include/asterisk/taskprocessor.h Thu May  1 12:58:20 2008
@@ -67,7 +67,7 @@
  * \param datap The data to pass to the task_exe function when the task is executed
  * \param src The calling function name (this will become DEBUG only)
  * \return A task structure ready to be queued into a taskprocessor, NULL on error */
-struct ast_task *ast_task_alloc(int (*task_exe)(void *datap), void *datap, char *src);
+struct ast_task *ast_task_alloc(int (*task_exe)(void *datap), void *datap);
 
 /*! \brief Free the task resources
  * \note This function does not free any memory pointed to by the data pointer.  It is

Modified: team/group/taskprocessors/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/taskprocessors/main/pbx.c?view=diff&rev=114933&r1=114932&r2=114933
==============================================================================
--- team/group/taskprocessors/main/pbx.c (original)
+++ team/group/taskprocessors/main/pbx.c Thu May  1 12:58:20 2008
@@ -8055,7 +8055,7 @@
 	if (!(sc = ast_calloc(1, sizeof(*sc) + strlen(device) + 1)))
 		return;
 	strcpy(sc->dev, device);
-	if (!(task = ast_task_alloc(handle_statechange, sc, "pbx-device_state_cb"))) {
+	if (!(task = ast_task_alloc(handle_statechange, sc))) {
 		ast_log(LOG_WARNING, "failed to allocate a task for a device state change notification\n");
 	} else if (ast_taskprocessor_push(taskprocessor, task) < 0) {
 		ast_log(LOG_WARNING, "failed to push a device state change notification to taskprocessor\n");

Modified: team/group/taskprocessors/main/taskprocessor.c
URL: http://svn.digium.com/view/asterisk/team/group/taskprocessors/main/taskprocessor.c?view=diff&rev=114933&r1=114932&r2=114933
==============================================================================
--- team/group/taskprocessors/main/taskprocessor.c (original)
+++ team/group/taskprocessors/main/taskprocessor.c Thu May  1 12:58:20 2008
@@ -43,8 +43,6 @@
 	int (*execute)(void *datap);
 	/*! \brief The data pointer for the task execute() function */
 	void *datap;
-	/*! \brief The function that allocated a task object (To become debug only) */
-	char source[256];
 	/*! \brief AST_LIST_ENTRY overhead */
 	AST_LIST_ENTRY(ast_task) list;
 };
@@ -121,13 +119,12 @@
 /*
  * Task allocation & free
  */
-struct ast_task *ast_task_alloc(int (*task_exe)(void *datap), void *datap, char *src)
+struct ast_task *ast_task_alloc(int (*task_exe)(void *datap), void *datap)
 {
 	struct ast_task *t;
 	if ((t = ast_calloc(1, sizeof(*t)))) {
 		t->execute = task_exe;
 		t->datap = datap;
-		ast_copy_string(t->source, src, sizeof(t->source));
 	}
 	return t;
 }
@@ -205,7 +202,7 @@
 		return CLI_SUCCESS;
 	}
 	ast_cli(a->fd, "\npinging %s ...", name);
-	if (!(t = ast_task_alloc(tps_taskprocessor_ping_handler, 0, "cli_tps_ping"))) {
+	if (!(t = ast_task_alloc(tps_taskprocessor_ping_handler, 0))) {
 		ast_cli(a->fd, "\n\tfailed to allocate a task\n\n");
 		ao2_ref(tps, -1);
 		return CLI_FAILURE;
@@ -294,7 +291,7 @@
 				continue;
 			}
 			if (!t->execute) {
-				ast_log(LOG_WARNING, "A task from '\%s\' has no function to execute\n", t->source);
+				ast_log(LOG_WARNING, "Task is missing a function to execute!\n");
 				ast_task_free(t);
 				continue;
 			}




More information about the svn-commits mailing list