logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject cvs commit: logging-log4net/src/Repository/Hierarchy Logger.cs
Date Mon, 13 Sep 2004 07:04:03 GMT
nicko       2004/09/13 00:04:03

  Modified:    src/Repository/Hierarchy Logger.cs
  Log:
  Perf fix to Logger. Added test before AcquireReaderLock
  
  Revision  Changes    Path
  1.5       +12 -9     logging-log4net/src/Repository/Hierarchy/Logger.cs
  
  Index: Logger.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Repository/Hierarchy/Logger.cs,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Logger.cs	23 Feb 2004 03:18:04 -0000	1.4
  +++ Logger.cs	13 Sep 2004 07:04:03 -0000	1.5
  @@ -430,18 +430,21 @@
   
   			for(Logger c=this; c != null; c=c.m_parent) 
   			{
  -				// Protected against simultaneous call to addAppender, removeAppender,...
  -				c.m_appenderLock.AcquireReaderLock();
  -				try
  +				if (c.m_appenderAttachedImpl != null) 
   				{
  -					if (c.m_appenderAttachedImpl != null) 
  +					// Protected against simultaneous call to addAppender, removeAppender,...
  +					c.m_appenderLock.AcquireReaderLock();
  +					try
   					{
  -						writes += c.m_appenderAttachedImpl.AppendLoopOnAppenders(loggingEvent);
  +						if (c.m_appenderAttachedImpl != null) 
  +						{
  +							writes += c.m_appenderAttachedImpl.AppendLoopOnAppenders(loggingEvent);
  +						}
  +					}
  +					finally
  +					{
  +						c.m_appenderLock.ReleaseReaderLock();
   					}
  -				}
  -				finally
  -				{
  -					c.m_appenderLock.ReleaseReaderLock();
   				}
   
   				if (!c.m_additive) 
  
  
  

Mime
View raw message