mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-23 19:54:17 +00:00
cleaning up stupid mess (lesson in regressions for Math`)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10472 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
412fc926ea
commit
9b98c2d512
4 files changed
+49
-3
No files matched your search
@@ -63,6 +63,34 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_lock(switch_core_sessio
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
#ifdef SWITCH_DEBUG_RWLOCKS
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_perform_read_lock_hangup(switch_core_session_t *session, const char *file, const char *func, int line)
|
||||
#else
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_read_lock_hangup(switch_core_session_t *session)
|
||||
#endif
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
|
||||
if (session->rwlock) {
|
||||
if (switch_test_flag(session, SSF_DESTROYED) || switch_channel_get_state(session->channel) >= CS_DONE) {
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
#ifdef SWITCH_DEBUG_RWLOCKS
|
||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_ERROR, "%s Read lock FAIL\n",
|
||||
switch_channel_get_name(session->channel));
|
||||
#endif
|
||||
} else {
|
||||
status = (switch_status_t) switch_thread_rwlock_tryrdlock(session->rwlock);
|
||||
#ifdef SWITCH_DEBUG_RWLOCKS
|
||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_ERROR, "%s Read lock ACQUIRED\n",
|
||||
switch_channel_get_name(session->channel));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef SWITCH_DEBUG_RWLOCKS
|
||||
SWITCH_DECLARE(void) switch_core_session_perform_write_lock(switch_core_session_t *session, const char *file, const char *func, int line)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user