proyal 2003/02/12 08:33:51
Modified: fortress/src/java/org/apache/avalon/fortress/impl/handler
AbstractComponentHandler.java
Log:
Need to synchronized prepareHandler method, not the auto-prepare-on get since the
async
ini only calls prepareHandler. The prior way was an invitation for a race condition.
Revision Changes Path
1.4 +4 -7
avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/handler/AbstractComponentHandler.java
Index: AbstractComponentHandler.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/handler/AbstractComponentHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractComponentHandler.java 10 Feb 2003 15:35:47 -0000 1.3
+++ AbstractComponentHandler.java 12 Feb 2003 16:33:51 -0000 1.4
@@ -148,7 +148,7 @@
*
* @throws Exception if unable to prepare handler
*/
- public void prepareHandler()
+ public synchronized void prepareHandler()
throws Exception
{
if( m_prepared )
@@ -193,12 +193,9 @@
public Object get()
throws Exception
{
- synchronized( this )
+ if( !m_prepared )
{
- if( !m_prepared )
- {
- prepareHandler();
- }
+ prepareHandler();
}
if( m_disposed )
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]