add in switch_core_signal_lock/unlock

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7737 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2008-02-26 16:55:40 +00:00
1 parent bd21deb1b1
commit be1abfe573
9 files changed
+39 -9

No files matched your search

@@ -2538,6 +2538,8 @@ static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlses
if ((session = ldl_session_get_private(dlsession))) {
switch_core_session_signal_lock(session);
tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
@@ -2559,7 +2561,7 @@ static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlses
}
if ((session = switch_core_session_request(dingaling_endpoint_interface, NULL)) != 0) {
switch_core_session_add_stream(session, NULL);
switch_core_session_signal_lock(session);
if ((tech_pvt = (struct private_object *) switch_core_session_alloc(session, sizeof(struct private_object))) != 0) {
char *exten;
@@ -2946,6 +2948,10 @@ static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlses
done:
if (session) {
switch_core_session_signal_unlock(session);
}
return status;
}
+5
View File
@@ -938,6 +938,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime)
if ((tech_pvt = iax_get_private(iaxevent->session))) {
channel = switch_core_session_get_channel(tech_pvt->session);
switch_core_session_signal_lock(tech_pvt->session);
}
if (globals.debug && iaxevent->etype != IAX_EVENT_VOICE) {
@@ -1115,6 +1116,10 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime)
break;
}
iax_event_free(iaxevent);
if (tech_pvt && tech_pvt->session) {
switch_core_session_signal_unlock(tech_pvt->session);
}
}
}
+1 -1
View File
@@ -708,7 +708,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_mutex_lock(tech_pvt->flag_mutex);
if (switch_channel_get_state(channel) >= CS_HANGUP || !tech_pvt) {
status = SWITCH_STATUS_FALSE;
goto end;
+3 -6
View File
@@ -222,8 +222,8 @@ void sofia_event_callback(nua_event_t event,
nua_event_name(event), status, phrase, session ? switch_channel_get_name(channel) : "n/a");
}
if (tech_pvt) {
switch_mutex_lock(tech_pvt->flag_mutex);
if (session) {
switch_core_session_signal_lock(session);
}
if ((profile->pflags & PFLAG_AUTH_ALL) && tech_pvt && tech_pvt->key && sip) {
@@ -352,11 +352,8 @@ void sofia_event_callback(nua_event_t event,
sofia_reg_release_gateway(gateway);
}
if (tech_pvt) {
switch_mutex_unlock(tech_pvt->flag_mutex);
}
if (session) {
switch_core_session_signal_unlock(session);
switch_core_session_rwunlock(session);
}
}