FS-9307: [mod_conference] don't close files until after video threads are done to avoid race condition trying to use closed file handle when playing a video file
This commit is contained in:
parent
78ebfff8e3
commit
1448ada505
|
@ -691,35 +691,6 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Close Unused Handles */
|
|
||||||
if (conference->fnode) {
|
|
||||||
conference_file_node_t *fnode, *cur;
|
|
||||||
switch_memory_pool_t *pool;
|
|
||||||
|
|
||||||
fnode = conference->fnode;
|
|
||||||
while (fnode) {
|
|
||||||
cur = fnode;
|
|
||||||
fnode = fnode->next;
|
|
||||||
|
|
||||||
if (cur->type != NODE_TYPE_SPEECH) {
|
|
||||||
conference_file_close(conference, cur);
|
|
||||||
}
|
|
||||||
|
|
||||||
pool = cur->pool;
|
|
||||||
switch_core_destroy_memory_pool(&pool);
|
|
||||||
}
|
|
||||||
conference->fnode = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (conference->async_fnode) {
|
|
||||||
switch_memory_pool_t *pool;
|
|
||||||
conference_file_close(conference, conference->async_fnode);
|
|
||||||
pool = conference->async_fnode->pool;
|
|
||||||
conference->async_fnode = NULL;
|
|
||||||
switch_core_destroy_memory_pool(&pool);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch_mutex_lock(conference->member_mutex);
|
switch_mutex_lock(conference->member_mutex);
|
||||||
for (imember = conference->members; imember; imember = imember->next) {
|
for (imember = conference->members; imember; imember = imember->next) {
|
||||||
switch_channel_t *channel;
|
switch_channel_t *channel;
|
||||||
|
@ -768,7 +739,6 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
|
||||||
}
|
}
|
||||||
switch_mutex_unlock(conference_globals.hash_mutex);
|
switch_mutex_unlock(conference_globals.hash_mutex);
|
||||||
|
|
||||||
|
|
||||||
conference_utils_clear_flag(conference, CFLAG_VIDEO_MUXING);
|
conference_utils_clear_flag(conference, CFLAG_VIDEO_MUXING);
|
||||||
|
|
||||||
for (x = 0; x <= conference->canvas_count; x++) {
|
for (x = 0; x <= conference->canvas_count; x++) {
|
||||||
|
@ -779,6 +749,34 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Close Unused Handles */
|
||||||
|
if (conference->fnode) {
|
||||||
|
conference_file_node_t *fnode, *cur;
|
||||||
|
switch_memory_pool_t *pool;
|
||||||
|
|
||||||
|
fnode = conference->fnode;
|
||||||
|
while (fnode) {
|
||||||
|
cur = fnode;
|
||||||
|
fnode = fnode->next;
|
||||||
|
|
||||||
|
if (cur->type != NODE_TYPE_SPEECH) {
|
||||||
|
conference_file_close(conference, cur);
|
||||||
|
}
|
||||||
|
|
||||||
|
pool = cur->pool;
|
||||||
|
switch_core_destroy_memory_pool(&pool);
|
||||||
|
}
|
||||||
|
conference->fnode = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (conference->async_fnode) {
|
||||||
|
switch_memory_pool_t *pool;
|
||||||
|
conference_file_close(conference, conference->async_fnode);
|
||||||
|
pool = conference->async_fnode->pool;
|
||||||
|
conference->async_fnode = NULL;
|
||||||
|
switch_core_destroy_memory_pool(&pool);
|
||||||
|
}
|
||||||
|
|
||||||
/* Wait till everybody is out */
|
/* Wait till everybody is out */
|
||||||
conference_utils_clear_flag_locked(conference, CFLAG_RUNNING);
|
conference_utils_clear_flag_locked(conference, CFLAG_RUNNING);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Lock ON\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Lock ON\n");
|
||||||
|
|
Loading…
Reference in New Issue