diff options
author | Steve Murphy <murf@digium.com> | 2008-04-22 14:38:46 +0000 |
---|---|---|
committer | Steve Murphy <murf@digium.com> | 2008-04-22 14:38:46 +0000 |
commit | 161b4abd796ef2126135a2caef268b1ac54f91bb (patch) | |
tree | b984c3a887dd7968073113d0ae18215bf43c91dc /channels | |
parent | 41fd7a6a21fc870f75ceb219d130e0bd6519636c (diff) |
Hopefully, this will resolve the issues that russellb had with this log_show_lock().
I gathered the code that filled the string, and put it in a different func which
I cryptically call "append_lock_information()".
Now, both log_show_lock(), and handle_show_locks() both call this code to do
the work. Tested, seems to work fine.
Also, log_show_lock was modified to use the ast_str stuff, along with checking
for successful ast_str creation, and freeing the ast_str obj when finished.
A break was inserted to terminate the search for the lock; we should never
see it twice.
An example usage in chan_sip.c was created as a comment, for instructional
purposes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 31bd5763d..391970be1 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12927,8 +12927,10 @@ static int dialog_needdestroy(void *dialogobj, void *arg, int flags) struct sip_pvt *dialog = dialogobj; time_t *t = arg; + /* log_show_lock(ao2_object_get_lockaddr(dialog)); this is an example of how to use log_show_lock() */ if (sip_pvt_trylock(dialog)) { - /* this path gets executed fairly frequently (3% or so) even in low load + /* In very short-duration calls via sipp, + this path gets executed fairly frequently (3% or so) even in low load situations; the routines we most commonly fight for a lock with: sip_answer (7 out of 9) sip_hangup (2 out of 9) |