[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "safe_construct_w_pool" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Aug 8 14:30:05 CDT 2012


branch "safe_construct_w_pool" has been updated
       via  d070d485e3030bcd5e4c1a6820e44ea0223cd754 (commit)
      from  df0edc0b3f42960b1fc2fd65ab19fb8b1f120406 (commit)

Summary of changes:
 src/PJSIPManager.cpp |    5 +++++
 src/SIPSession.cpp   |   17 -----------------
 2 files changed, 5 insertions(+), 17 deletions(-)


- Log -----------------------------------------------------------------
commit d070d485e3030bcd5e4c1a6820e44ea0223cd754
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Aug 8 16:47:00 2012 -0230

    Reverting change made in commit 3dd0ab1b6ac94f6e8cc41a70e568ab9fbcad17ff.  This
    causes race conditions on pjsip memory pools when the invite session is
    destroyed. It appears that if everything else is working properly this code
    should not be necessary anyways.
    
    The other change introduces a tiny sleep the pjsip polling thread to encourage
    yields in a more timely manner. Otherwise, if a system manages to load up pjsip
    with a lot of waiting work, this thread will dominate things. Something to look
    at: even if this thread is running crazy, on a multi-core system thread pool
    worker threads should make some headway, but this simply isn't happening. There
    is some kind of contention occurring.

diff --git a/src/PJSIPManager.cpp b/src/PJSIPManager.cpp
index 9a0f31f..078a519 100644
--- a/src/PJSIPManager.cpp
+++ b/src/PJSIPManager.cpp
@@ -251,6 +251,11 @@ void PJSIPManager::handleEvents()
     onHandleEvents(mModules);
     const pj_time_val delay = {0, 10};
     pjsip_endpt_handle_events(mEndpoint, &delay);
+    //
+    // 10 ms is nothing.. but this is really about trying to yielding so some
+    // other threads can do something.
+    //
+    pj_thread_sleep(50);
 }
 
 void PJSIPManager::setUserAgent(const string& userAgent)
diff --git a/src/SIPSession.cpp b/src/SIPSession.cpp
index a84a1c5..1b326f9 100755
--- a/src/SIPSession.cpp
+++ b/src/SIPSession.cpp
@@ -3371,23 +3371,6 @@ public:
         }
         mSessionPriv->mEndpoint->removeSession(mSession);
 
-        if (mSessionPriv->mInviteSession)
-        {
-            pjsip_tx_data* tdata;
-            pj_status_t result = pjsip_inv_end_session(mSessionPriv->mInviteSession, 200, 0, &tdata);
-            //
-            // We don't care about this data... we should've already sent everything. Really tdata should be 0 here.
-            //
-            if (result == PJ_SUCCESS && tdata)
-            {
-                result = pjsip_inv_send_msg(mSessionPriv->mInviteSession, tdata);
-                if (result != PJ_SUCCESS)
-                {
-                    lg(Debug) << "We were trying to do the right thing here...";
-                }
-            }
-        }
-
         //
         // We moved the clean up of this object to here to avoid conflicts between pjsip originating operations
         // and the pending operations in the session object. The only other way to do it would've been to have

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list