const char *cflags_str, *v_cflags_str;
member_flag_t mflags[MFLAG_MAX] = { 0 };
switch_core_session_message_t msg = { 0 };
- uint8_t rl = 0, isbr = 0;
+ uint8_t isbr = 0;
char *dpin = "";
const char *mdpin = "";
conference_xml_cfg_t xml_cfg = { 0 };
/* Indicate the conference is dynamic */
conference_utils_set_flag_locked(conference, CFLAG_DYNAMIC);
- /* acquire a read lock on the thread so it can't leave without us */
- if (switch_thread_rwlock_tryrdlock(conference->rwlock) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Read Lock Fail\n");
- goto done;
- }
-
- rl++;
-
/* Start the conference thread for this conference */
conference_launch_thread(conference);
} else { /* setup user variable */
switch_channel_set_variable(channel, "conference_name", conference->name);
switch_channel_set_variable(channel, SWITCH_RFC7989_APP_SESSION_ID_VARIABLE, conference->uuid_str);
- rl++;
}
/* Moderator PIN as a channel variable */
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
/* release the readlock */
- if (rl) {
+ if (conference) {
switch_thread_rwlock_unlock(conference->rwlock);
}
switch_event_fire(&event);
end:
+ if (conference) {
+ switch_thread_rwlock_rdlock(conference->rwlock);
+ }
switch_mutex_unlock(conference_globals.hash_mutex);