[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] engine/core bcastmgr.cpp,1.95,1.96
From:       jzeng () helixcommunity ! org
Date:       2010-05-12 18:45:58
Message-ID: 201005121845.o4CIjdTe020347 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/core
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv32760

Modified Files:
	bcastmgr.cpp 
Log Message:
Synopsis
============ 
Bug 261582:   W2K8 had bad response to an encoder instance behaving
oddly
Branches:  head, SERVER_14_RN
Suggested Reviewer: Jamie

Description
===========
The fix is a guess without repro.  From the stacks, it looks like m_pGateway is gone when
RemoveBroadcastStreamer is called.  From the code we can see that
HXAtomicDecUINT32(&m_pGateway->m_ulPlayerCount); is called before RemoveBroadcastStreamer.  

m_ulPlayerCount is like refcount for BroadcastGatway. When it gets decreased to 0, the
DestructCallback in the broadcast plugin process may release the gateway, and causes everything to
be released.

This fix is to switch the sequence, RemoveBroadcastStreamer will be called first, then the decrease
of m_ulPlayerCount.  This way we guarantee the gateway exists when  RemoveBroadcastStreamer is
called.

cvFiles Affected
==============
server/engine/core/bcastmgr.cpp

Testing Performed
================= 

Unit Tests: 
None. 

Integration Tests: 
None.

Leak Tests: 
None. 

Performance Tests: 
- None 

Platforms Tested: win32-i386-vc7
Build verified: win32-i386-vc7 







Index: bcastmgr.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/bcastmgr.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- bcastmgr.cpp	22 Apr 2010 15:07:44 -0000	1.95
+++ bcastmgr.cpp	12 May 2010 18:45:56 -0000	1.96
@@ -435,8 +435,8 @@
     HX_RELEASE(m_pStreamDoneCallback);
     HX_VECTOR_DELETE(m_pbPacketsStarted);
 
-    HXAtomicDecUINT32(&m_pGateway->m_ulPlayerCount);
     m_pGateway->RemoveBroadcastStreamer(m_pProc, this);
+    HXAtomicDecUINT32(&m_pGateway->m_ulPlayerCount);
     m_bSourceAborted = TRUE;
 
     // update registry's count of active players for the stream assoc. with this gateway


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic