mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
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:
@@ -235,7 +235,11 @@ static void default_listener_shutdown(struct ast_taskprocessor_listener *listene
|
||||
/* Hold a reference during shutdown */
|
||||
ao2_t_ref(listener->tps, +1, "tps-shutdown");
|
||||
|
||||
ast_taskprocessor_push(listener->tps, default_listener_die, pvt);
|
||||
if (ast_taskprocessor_push(listener->tps, default_listener_die, pvt)) {
|
||||
/* This will cause the thread to exit early without completing tasks already
|
||||
* in the queue. This is probably the least bad option in this situation. */
|
||||
default_listener_die(pvt);
|
||||
}
|
||||
|
||||
ast_assert(pvt->poll_thread != AST_PTHREADT_NULL);
|
||||
|
||||
|
Reference in New Issue
Block a user