change CS_DONE to CS_DESTROY and add state handler for destroy and tear down critical parts of the channel from this method which is not called until it's impossible for anything to be referencing the channel (after final write lock and before destroying the pool)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12986 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-04-10 17:43:18 +00:00
parent 05348829aa
commit ab6c4f1a6d
19 changed files with 346 additions and 117 deletions
+2
View File
@@ -578,6 +578,8 @@ SWITCH_DECLARE(void) switch_core_session_perform_destroy(_Inout_ switch_core_ses
*/
#define switch_core_session_destroy(session) switch_core_session_perform_destroy(session, __FILE__, __SWITCH_FUNC__, __LINE__)
SWITCH_DECLARE(void) switch_core_session_destroy_state(switch_core_session_t *session);
/*!
\brief Provide the total number of sessions
\return the total number of allocated sessions
+4 -1
View File
@@ -56,7 +56,8 @@ typedef enum {
SWITCH_SHN_ON_HIBERNATE,
SWITCH_SHN_ON_RESET,
SWITCH_SHN_ON_PARK,
SWITCH_SHN_ON_REPORTING
SWITCH_SHN_ON_REPORTING,
SWITCH_SHN_ON_DESTROY
} switch_state_handler_name_t;
struct switch_state_handler_table {
@@ -82,6 +83,8 @@ struct switch_state_handler_table {
switch_state_handler_t on_park;
/*! executed when the state changes to reporting */
switch_state_handler_t on_reporting;
/*! executed when the state changes to destroy */
switch_state_handler_t on_destroy;
void *padding[10];
};
+2 -2
View File
@@ -787,7 +787,7 @@ CS_HIBERNATE - Channel is in a sleep state.
CS_RESET - Channel is in a reset state.
CS_HANGUP - Channel is flagged for hangup and ready to end.
CS_REPORTING - Channel is ready to collect call detail.
CS_DONE - Channel is ready to be destroyed and out of the state machine
CS_DESTROY - Channel is ready to be destroyed and out of the state machine
</pre>
*/
typedef enum {
@@ -803,7 +803,7 @@ typedef enum {
CS_RESET,
CS_HANGUP,
CS_REPORTING,
CS_DONE,
CS_DESTROY,
CS_NONE
} switch_channel_state_t;