mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-18 09:32:34 +00:00
Fix erlang deadlock
Release session R/W Lock
This commit is contained in:
parent
bf84e9d414
commit
e6e0deba54
@ -358,6 +358,7 @@ static switch_status_t handle_msg_session_event(listener_t *listener, erlang_msg
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch_thread_rwlock_unlock(session->event_rwlock);
|
switch_thread_rwlock_unlock(session->event_rwlock);
|
||||||
|
switch_thread_rwlock_unlock(session->rwlock);
|
||||||
|
|
||||||
ei_x_encode_atom(rbuf, "ok");
|
ei_x_encode_atom(rbuf, "ok");
|
||||||
} else {
|
} else {
|
||||||
@ -462,6 +463,7 @@ static switch_status_t handle_msg_session_nixevent(listener_t *listener, erlang_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch_thread_rwlock_unlock(session->event_rwlock);
|
switch_thread_rwlock_unlock(session->event_rwlock);
|
||||||
|
switch_thread_rwlock_unlock(session->rwlock);
|
||||||
|
|
||||||
ei_x_encode_atom(rbuf, "ok");
|
ei_x_encode_atom(rbuf, "ok");
|
||||||
} else { /* no session for this pid */
|
} else { /* no session for this pid */
|
||||||
@ -594,6 +596,8 @@ static switch_status_t handle_msg_session_setevent(listener_t *listener, erlang_
|
|||||||
session->event_hash = event_hash;
|
session->event_hash = event_hash;
|
||||||
switch_thread_rwlock_unlock(session->event_rwlock);
|
switch_thread_rwlock_unlock(session->event_rwlock);
|
||||||
|
|
||||||
|
switch_thread_rwlock_unlock(session->rwlock);
|
||||||
|
|
||||||
/* TODO - we should flush any non-matching events from the queue */
|
/* TODO - we should flush any non-matching events from the queue */
|
||||||
ei_x_encode_atom(rbuf, "ok");
|
ei_x_encode_atom(rbuf, "ok");
|
||||||
} else { /* no session for this pid */
|
} else { /* no session for this pid */
|
||||||
@ -1076,6 +1080,8 @@ static switch_status_t handle_msg_atom(listener_t *listener, erlang_msg * msg, e
|
|||||||
switch_core_hash_delete_multi(session->event_hash, NULL, NULL);
|
switch_core_hash_delete_multi(session->event_hash, NULL, NULL);
|
||||||
switch_thread_rwlock_unlock(session->event_rwlock);
|
switch_thread_rwlock_unlock(session->event_rwlock);
|
||||||
|
|
||||||
|
switch_thread_rwlock_unlock(session->rwlock);
|
||||||
|
|
||||||
ei_x_encode_atom(rbuf, "ok");
|
ei_x_encode_atom(rbuf, "ok");
|
||||||
} else {
|
} else {
|
||||||
ei_x_encode_tuple_header(rbuf, 2);
|
ei_x_encode_tuple_header(rbuf, 2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user