mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +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:
@@ -1111,13 +1111,15 @@ static void destroy_conference_bridge(void *obj)
|
||||
if (conference->playback_queue) {
|
||||
struct hangup_data hangup;
|
||||
hangup_data_init(&hangup, conference);
|
||||
ast_taskprocessor_push(conference->playback_queue, hangup_playback, &hangup);
|
||||
|
||||
ast_mutex_lock(&hangup.lock);
|
||||
while (!hangup.hungup) {
|
||||
ast_cond_wait(&hangup.cond, &hangup.lock);
|
||||
if (!ast_taskprocessor_push(conference->playback_queue, hangup_playback, &hangup)) {
|
||||
ast_mutex_lock(&hangup.lock);
|
||||
while (!hangup.hungup) {
|
||||
ast_cond_wait(&hangup.cond, &hangup.lock);
|
||||
}
|
||||
ast_mutex_unlock(&hangup.lock);
|
||||
}
|
||||
ast_mutex_unlock(&hangup.lock);
|
||||
|
||||
hangup_data_destroy(&hangup);
|
||||
} else {
|
||||
/* Playback queue is not yet allocated. Just hang up the channel straight */
|
||||
|
Reference in New Issue
Block a user