fix race condition when hangup happends after answer indication but before the session thread is started

This commit is contained in:
Anthony Minessale
2010-05-03 13:29:56 -04:00
committed by Sangoma Dev Box
parent 652d2fdfb3
commit 9096501ee4
5 changed files with 47 additions and 17 deletions
+3 -2
View File
@@ -92,7 +92,9 @@ typedef enum {
SSF_NONE = 0,
SSF_DESTROYED = (1 << 0),
SSF_WARN_TRANSCODE = (1 << 1),
SSF_HANGUP = (1 << 2)
SSF_HANGUP = (1 << 2),
SSF_THREAD_STARTED = (1 << 3),
SSF_THREAD_RUNNING = (1 << 4)
} switch_session_flag_t;
@@ -103,7 +105,6 @@ struct switch_core_session {
switch_endpoint_interface_t *endpoint_interface;
switch_size_t id;
switch_session_flag_t flags;
int thread_running;
switch_channel_t *channel;
switch_io_event_hooks_t event_hooks;
+1
View File
@@ -479,6 +479,7 @@ SWITCH_DECLARE(void) switch_core_session_run(_In_ switch_core_session_t *session
\param session the session on which to check
*/
SWITCH_DECLARE(unsigned int) switch_core_session_running(_In_ switch_core_session_t *session);
SWITCH_DECLARE(unsigned int) switch_core_session_started(_In_ switch_core_session_t *session);
SWITCH_DECLARE(void *) switch_core_perform_permanent_alloc(_In_ switch_size_t memory, _In_z_ const char *file, _In_z_ const char *func, _In_ int line);