diff options
author | Mark Michelson <mmichelson@digium.com> | 2012-12-10 20:14:23 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2012-12-10 20:14:23 +0000 |
commit | 1310e659bd0b4b0ce8210b5b1318ae71d86b85e2 (patch) | |
tree | 8e097572cfef1f0b05602f7ef17ec10f4fb3c439 /main/taskprocessor.c | |
parent | 90d76a50263a6ff509d2b26c9953c2d700854a9b (diff) |
Solve the issue about the "CHANGE THIS" and "XXX CHANGE THIS XXX" taskprocessor names.
Unfortunately, this required a taskprocessor listener change that makes listener allocation
utterly silly. I'm going to change the scheme so that allocation of taskprocessor listeners
is done internally within taskprocessor code. This will make it parallel with threadpool
code, which is a good thing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/taskprocessor.c')
-rw-r--r-- | main/taskprocessor.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/main/taskprocessor.c b/main/taskprocessor.c index fc183b409..a1e54a3b4 100644 --- a/main/taskprocessor.c +++ b/main/taskprocessor.c @@ -485,10 +485,6 @@ struct ast_taskprocessor_listener *ast_taskprocessor_listener_alloc(const struct return NULL; } listener->callbacks = callbacks; - listener->private_data = listener->callbacks->alloc(listener); - if (!listener->private_data) { - return NULL; - } ao2_ref(listener, +1); return listener; @@ -559,6 +555,11 @@ struct ast_taskprocessor *ast_taskprocessor_create_with_listener(const char *nam ao2_ref(p, +1); listener->tps = p; + listener->private_data = listener->callbacks->alloc(listener); + if (!listener->private_data) { + return NULL; + } + if (!(ao2_link(tps_singletons, p))) { ast_log(LOG_ERROR, "Failed to add taskprocessor '%s' to container\n", p->name); return NULL; |