summaryrefslogtreecommitdiff
path: root/main/taskprocessor.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-03-22 19:51:16 +0000
committerKinsey Moore <kmoore@digium.com>2012-03-22 19:51:16 +0000
commitc5b3db1956a3db2446b0310b3a7d59961fe3e089 (patch)
tree530b55034f5adfb0c7106ae1194679a031afc888 /main/taskprocessor.c
parent1d1c28ac4b09df2b663123e55239e411b8f5ad26 (diff)
Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/taskprocessor.c')
-rw-r--r--main/taskprocessor.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/main/taskprocessor.c b/main/taskprocessor.c
index 782a34451..a7416df46 100644
--- a/main/taskprocessor.c
+++ b/main/taskprocessor.c
@@ -143,7 +143,7 @@ static struct tps_task *tps_task_alloc(int (*task_exe)(void *datap), void *datap
return t;
}
-/* release task resources */
+/* release task resources */
static void *tps_task_free(struct tps_task *task)
{
if (task) {
@@ -153,7 +153,7 @@ static void *tps_task_free(struct tps_task *task)
}
/* taskprocessor tab completion */
-static char *tps_taskprocessor_tab_complete(struct ast_taskprocessor *p, struct ast_cli_args *a)
+static char *tps_taskprocessor_tab_complete(struct ast_taskprocessor *p, struct ast_cli_args *a)
{
int tklen;
int wordnum = 0;
@@ -198,7 +198,7 @@ static char *cli_tps_ping(struct ast_cli_entry *e, int cmd, struct ast_cli_args
switch (cmd) {
case CLI_INIT:
e->command = "core ping taskprocessor";
- e->usage =
+ e->usage =
"Usage: core ping taskprocessor <taskprocessor>\n"
" Displays the time required for a task to be processed\n";
return NULL;
@@ -230,7 +230,7 @@ static char *cli_tps_ping(struct ast_cli_entry *e, int cmd, struct ast_cli_args
delta = ast_tvsub(end, begin);
ast_cli(a->fd, "\n\t%24s ping time: %.1ld.%.6ld sec\n\n", name, (long)delta.tv_sec, (long int)delta.tv_usec);
ao2_ref(tps, -1);
- return CLI_SUCCESS;
+ return CLI_SUCCESS;
}
static char *cli_tps_report(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -246,12 +246,12 @@ static char *cli_tps_report(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
switch (cmd) {
case CLI_INIT:
e->command = "core show taskprocessors";
- e->usage =
+ e->usage =
"Usage: core show taskprocessors\n"
" Shows a list of instantiated task processors and their statistics\n";
return NULL;
case CLI_GENERATE:
- return NULL;
+ return NULL;
}
if (a->argc != e->args)
@@ -268,9 +268,9 @@ static char *cli_tps_report(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
ao2_ref(p, -1);
}
ao2_iterator_destroy(&i);
- tcount = ao2_container_count(tps_singletons);
+ tcount = ao2_container_count(tps_singletons);
ast_cli(a->fd, "\n\t+---------------------+-----------------+------------+-------------+\n\t%d taskprocessors\n\n", tcount);
- return CLI_SUCCESS;
+ return CLI_SUCCESS;
}
/* this is the task processing worker function */
@@ -286,42 +286,42 @@ static void *tps_processing_function(void *data)
}
while (i->poll_thread_run) {
- ast_mutex_lock(&i->taskprocessor_lock);
- if (!i->poll_thread_run) {
- ast_mutex_unlock(&i->taskprocessor_lock);
- break;
- }
- if (!(size = tps_taskprocessor_depth(i))) {
- ast_cond_wait(&i->poll_cond, &i->taskprocessor_lock);
- if (!i->poll_thread_run) {
- ast_mutex_unlock(&i->taskprocessor_lock);
- break;
+ ast_mutex_lock(&i->taskprocessor_lock);
+ if (!i->poll_thread_run) {
+ ast_mutex_unlock(&i->taskprocessor_lock);
+ break;
+ }
+ if (!(size = tps_taskprocessor_depth(i))) {
+ ast_cond_wait(&i->poll_cond, &i->taskprocessor_lock);
+ if (!i->poll_thread_run) {
+ ast_mutex_unlock(&i->taskprocessor_lock);
+ break;
}
- }
- ast_mutex_unlock(&i->taskprocessor_lock);
- /* stuff is in the queue */
- if (!(t = tps_taskprocessor_pop(i))) {
- ast_log(LOG_ERROR, "Wtf?? %d tasks in the queue, but we're popping blanks!\n", size);
- continue;
- }
- if (!t->execute) {
- ast_log(LOG_WARNING, "Task is missing a function to execute!\n");
- tps_task_free(t);
- continue;
- }
- t->execute(t->datap);
-
- ast_mutex_lock(&i->taskprocessor_lock);
- if (i->stats) {
- i->stats->_tasks_processed_count++;
- if (size > i->stats->max_qsize) {
- i->stats->max_qsize = size;
- }
- }
- ast_mutex_unlock(&i->taskprocessor_lock);
-
- tps_task_free(t);
- }
+ }
+ ast_mutex_unlock(&i->taskprocessor_lock);
+ /* stuff is in the queue */
+ if (!(t = tps_taskprocessor_pop(i))) {
+ ast_log(LOG_ERROR, "Wtf?? %d tasks in the queue, but we're popping blanks!\n", size);
+ continue;
+ }
+ if (!t->execute) {
+ ast_log(LOG_WARNING, "Task is missing a function to execute!\n");
+ tps_task_free(t);
+ continue;
+ }
+ t->execute(t->datap);
+
+ ast_mutex_lock(&i->taskprocessor_lock);
+ if (i->stats) {
+ i->stats->_tasks_processed_count++;
+ if (size > i->stats->max_qsize) {
+ i->stats->max_qsize = size;
+ }
+ }
+ ast_mutex_unlock(&i->taskprocessor_lock);
+
+ tps_task_free(t);
+ }
while ((t = tps_taskprocessor_pop(i))) {
tps_task_free(t);
}
@@ -404,14 +404,14 @@ const char *ast_taskprocessor_name(struct ast_taskprocessor *tps)
}
/* Provide a reference to a taskprocessor. Create the taskprocessor if necessary, but don't
- * create the taskprocessor if we were told via ast_tps_options to return a reference only
+ * create the taskprocessor if we were told via ast_tps_options to return a reference only
* if it already exists */
struct ast_taskprocessor *ast_taskprocessor_get(const char *name, enum ast_tps_options create)
{
struct ast_taskprocessor *p, tmp_tps = {
.name = name,
};
-
+
if (ast_strlen_zero(name)) {
ast_log(LOG_ERROR, "requesting a nameless taskprocessor!!!\n");
return NULL;
@@ -480,7 +480,7 @@ void *ast_taskprocessor_unreference(struct ast_taskprocessor *tps)
return NULL;
}
-/* push the task into the taskprocessor queue */
+/* push the task into the taskprocessor queue */
int ast_taskprocessor_push(struct ast_taskprocessor *tps, int (*task_exe)(void *datap), void *datap)
{
struct tps_task *t;