Skip to content
Snippets Groups Projects
Commit ec68a156 authored by Mark Michelson's avatar Mark Michelson
Browse files

Test that shutdown callback is called when expected.


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 2b36cbe2
Branches
Tags
No related merge requests found
...@@ -565,6 +565,7 @@ struct ast_taskprocessor *ast_taskprocessor_create_with_listener(const char *nam ...@@ -565,6 +565,7 @@ struct ast_taskprocessor *ast_taskprocessor_create_with_listener(const char *nam
void *ast_taskprocessor_unreference(struct ast_taskprocessor *tps) void *ast_taskprocessor_unreference(struct ast_taskprocessor *tps)
{ {
struct ast_taskprocessor_listener *listener; struct ast_taskprocessor_listener *listener;
if (!tps) { if (!tps) {
return NULL; return NULL;
} }
......
...@@ -239,8 +239,16 @@ AST_TEST_DEFINE(taskprocessor_listener) ...@@ -239,8 +239,16 @@ AST_TEST_DEFINE(taskprocessor_listener)
goto test_exit; goto test_exit;
} }
tps = ast_taskprocessor_unreference(tps);
if (!pvt->shutdown) {
res = AST_TEST_FAIL;
goto test_exit;
}
test_exit: test_exit:
ao2_ref(listener, -1); ao2_ref(listener, -1);
/* This is safe even if tps is NULL */
ast_taskprocessor_unreference(tps); ast_taskprocessor_unreference(tps);
return res; return res;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment