kill mysterious race bug that magicly showed up last week

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5455 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-06-24 19:47:39 +00:00
parent 700aa0df56
commit 158d1f4631
1 changed files with 6 additions and 4 deletions

View File

@ -1576,6 +1576,8 @@ static void conference_loop_output(conference_member_t * member)
switch_event_t *event;
caller_control_action_t *caller_action = NULL;
switch_mutex_lock(member->flag_mutex);
if (switch_core_session_dequeue_event(member->session, &event) == SWITCH_STATUS_SUCCESS) {
char *from = switch_event_get_header(event, "from");
char *to = switch_event_get_header(event, "to");
@ -1649,7 +1651,6 @@ static void conference_loop_output(conference_member_t * member)
/* handle file and TTS frames */
if (member->fnode) {
switch_mutex_lock(member->flag_mutex);
/* if we are done, clean it up */
if (member->fnode->done) {
conference_file_node_t *fnode;
@ -1707,7 +1708,6 @@ static void conference_loop_output(conference_member_t * member)
}
}
}
switch_mutex_unlock(member->flag_mutex);
} else { /* send the conferecne frame to the call leg */
switch_buffer_t *use_buffer = NULL;
uint32_t mux_used = (uint32_t) switch_buffer_inuse(member->mux_buffer);
@ -1770,6 +1770,7 @@ static void conference_loop_output(conference_member_t * member)
switch_core_timer_next(&timer);
}
}
switch_mutex_unlock(member->flag_mutex);
} /* Rinse ... Repeat */
if (member->digit_stream != NULL) {
@ -3229,12 +3230,13 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t * conference, swit
}
/* move the member from the old conference to the new one */
switch_mutex_lock(member->flag_mutex);
conference_del_member(conference, member);
conference_add_member(new_conference, member);
switch_mutex_unlock(new_conference->mutex);
switch_mutex_unlock(member->flag_mutex);
stream->write_function(stream, "OK Members sent to conference %s.\n", argv[2]);
/* tell them what happened */
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(channel, event);