taskprocessor: Warn on unused result from pushing task.

Add attribute_warn_unused_result to ast_taskprocessor_push,
ast_taskprocessor_push_local and ast_threadpool_push.  This will help
ensure we perform the necessary cleanup upon failure.

Change-Id: I7e4079bd7b21cfe52fb431ea79e41314520c3f6d
This commit is contained in:
Corey Farrell
2018-10-14 08:58:59 -04:00
parent e349bf40ca
commit 5ab94d2a3e
8 changed files with 161 additions and 57 deletions

View File

@@ -561,7 +561,10 @@ struct stasis_subscription *stasis_unsubscribe(struct stasis_subscription *sub)
/* When all that's done, remove the ref the mailbox has on the sub */
if (sub->mailbox) {
ast_taskprocessor_push(sub->mailbox, sub_cleanup, sub);
if (ast_taskprocessor_push(sub->mailbox, sub_cleanup, sub)) {
/* Nothing we can do here, the conditional is just to keep
* the compiler happy that we're not ignoring the result. */
}
}
/* Unsubscribing unrefs the subscription */