[Opalvoip-svn] SF.net SVN: opalvoip:[34803] opal/branches/v3_16
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2016-05-02 08:14:40
|
Revision: 34803 http://sourceforge.net/p/opalvoip/code/34803 Author: rjongbloed Date: 2016-05-02 08:14:37 +0000 (Mon, 02 May 2016) Log Message: ----------- Merged revision(s) 34784 from opal/trunk: Fixed termination pseudo deadlock issue, if one media session transport subchannel fails, close them all, or the remaining open ones take a long time for their threads to terminate, effectively deadlocking. Modified Paths: -------------- opal/branches/v3_16/include/opal/mediasession.h opal/branches/v3_16/src/opal/mediasession.cxx Property Changed: ---------------- opal/branches/v3_16/ Index: opal/branches/v3_16 =================================================================== --- opal/branches/v3_16 2016-05-02 08:06:39 UTC (rev 34802) +++ opal/branches/v3_16 2016-05-02 08:14:37 UTC (rev 34803) Property changes on: opal/branches/v3_16 ___________________________________________________________________ Modified: svn:mergeinfo ## -14,6 +14,6 ## /opal/branches/v3_4:21060,21062,21088,21092,21111,21113,21115,21119,21143,21148,21151-21152,21155,21158,21184,21188,21253,21265-21266,21283-21284,21298,21300,21303,21307,21309,21311,21327,21331,21333,21359,21367,21369,21488,21556,21564-21565,21568,21570,21620,21625,21631,21748,21751,21756,21759,21761,21767,21770,22246,23044,23140,23143,23286 /opal/branches/v3_6:22169,22178,22184,22186,22197,22204,22216,22251,22253,22255,22258,22260,22291,22296,22300,22306,22308,22313,22319,22336,22353,22358,22436,22447,22449,22497,22511,22517,22519-22521,22527,22536,22538,22589,22596,22599,22617,22620,22622,22630,22640,22655,22675,22682,22726-22728,22730,22733,22738,22745-22746,22800,22820-22821,22842,22844-22845,22851,22853,22889,22896,22902,22904,22906,22918,22924,22928,22946,22965,22967,22976,22978,22980,22982,22994,23028,23123,23125-23126,23128,23157,23165,23173,23175,23183,23294,23341,23465,23467,23474,23521,23829,24346,24809 /opal/branches/v3_8:24025,24027,24029,24036,24038,24040,24042,24048,24050,24058,24061,24068,24071,24074,24076,24080,24082,24086-24087,24092,24099,24101,24105,24107,24109,24111,24114,24116-24117,24120-24121,24125,24127,24130,24132,24134,24138,24140,24144,24146,24148,24150-24151,24154,24156,24158,24162,24170,24218,24245,24257,24261,24340,24362-24363,24365,24369,24373,24422,24440,24442,24447,24489,24504,24506,24532,24536,24545,24547,24552,24554,24614,24678,24687,24699,24705,24775,24833,24861,24903,25146 -/opal/trunk:34112-34116,34118-34120,34122,34137-34139,34155-34156,34161-34165,34168,34170,34173,34177,34187-34190,34208,34218,34222,34237-34238,34246-34252,34269-34271,34281-34288,34297,34300,34303-34316,34333,34346,34365,34375,34377,34382-34384,34390,34393-34394,34399,34417-34421,34424,34430,34432,34435-34437,34440,34442,34455-34456,34480,34483-34484,34487-34488,34490-34491,34502-34503,34506,34588-34589,34718,34735,34746,34775 +/opal/trunk:34112-34116,34118-34120,34122,34137-34139,34155-34156,34161-34165,34168,34170,34173,34177,34187-34190,34208,34218,34222,34237-34238,34246-34252,34269-34271,34281-34288,34297,34300,34303-34316,34333,34346,34365,34375,34377,34382-34384,34390,34393-34394,34399,34417-34421,34424,34430,34432,34435-34437,34440,34442,34455-34456,34480,34483-34484,34487-34488,34490-34491,34502-34503,34506,34588-34589,34718,34735,34746,34775,34784 /ptlib/branches/v2_8:24136 /ptlib/trunk:20820 \ No newline at end of property Modified: opal/branches/v3_16/include/opal/mediasession.h =================================================================== --- opal/branches/v3_16/include/opal/mediasession.h 2016-05-02 08:06:39 UTC (rev 34802) +++ opal/branches/v3_16/include/opal/mediasession.h 2016-05-02 08:14:37 UTC (rev 34803) @@ -451,6 +451,7 @@ void SetRemoteBehindNAT(); protected: + virtual void InternalClose(); virtual void InternalStop(); PString m_name; @@ -471,7 +472,6 @@ ); void ThreadMain(); bool HandleUnavailableError(); - void Close(); typedef PNotifierListTemplate<PBYTEArray> NotifierList; NotifierList m_notifiers; Modified: opal/branches/v3_16/src/opal/mediasession.cxx =================================================================== --- opal/branches/v3_16/src/opal/mediasession.cxx 2016-05-02 08:06:39 UTC (rev 34802) +++ opal/branches/v3_16/src/opal/mediasession.cxx 2016-05-02 08:14:37 UTC (rev 34803) @@ -697,7 +697,7 @@ PTRACE(2, m_owner, *m_owner << m_subchannel << " timed out (" << m_channel->GetReadTimeout() << "s), other subchannels running"); else { PTRACE(1, m_owner, *m_owner << m_subchannel << " timed out (" << m_owner->m_mediaTimeout << "s), closing"); - Close(); + m_owner->InternalClose(); } break; @@ -705,7 +705,7 @@ PTRACE(1, m_owner, *m_owner << m_subchannel << " read error (" << m_channel->GetErrorNumber(PChannel::LastReadError) << "): " << m_channel->GetErrorText(PChannel::LastReadError)); - Close(); + m_owner->InternalClose(); break; } } @@ -732,22 +732,25 @@ PTRACE(2, m_owner, *m_owner << m_subchannel << ' ' << m_owner->m_maxNoTransmitTime << " seconds of transmit fails to " << m_owner->GetRemoteAddress(m_subchannel)); - Close(); + m_owner->InternalClose(); return false; } -void OpalMediaTransport::Transport::Close() +void OpalMediaTransport::InternalClose() { - if (m_channel == NULL) + if (!LockReadOnly()) return; - PChannel * base = m_channel->GetBaseReadChannel(); - if (base == NULL) - return; + for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) { + if (it->m_channel != NULL) { + PChannel * base = it->m_channel->GetBaseReadChannel(); + if (base != NULL) + base->Close(); + } + } - base->Close(); - m_owner->InternalRxData(m_subchannel, PBYTEArray()); + UnlockReadOnly(); } @@ -800,10 +803,7 @@ void OpalMediaTransport::InternalStop() { PTRACE(4, *this << "stopping " << m_subchannels.size() << "subchannels."); - LockReadOnly(); - for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) - it->Close(); - UnlockReadOnly(); + InternalClose(); for (vector<Transport>::iterator it = m_subchannels.begin(); it != m_subchannels.end(); ++it) { if (it->m_thread != NULL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |