Hi Troops,
Hope all is well.
I've been looking at an issue in ActiveMonitor today, where during
disposal of the component the current thread blocks till the monitor
thread dies (ActiveMonitor.stop()).
This causes problems in our environment because our monitor interval
is set to 30 mins, which means ActiveMonitor.stop() could take up
to 30 mins to complete due to the current thread waiting for the
monitor thread to complete.
I changed the code to do an interrupt() instead of a join(), ie. to
interrupt the monitor thread out of it's sleep(), and everything worked
fine. The actual diff is below.
Just wondering if there are any issues or problems with this change
that I'm not aware of ? If so, any ideas how to fix the original
problem ?
Cheers,
Marcus
Index: src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/monitor/src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java,v
retrieving revision 1.3
diff -u -r1.3 ActiveMonitor.java
--- src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java 8 Sep
2002 00:02:45 -0000 1.3
+++ src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java 27 Sep
+2002 13:15:14 -0000
@@ -80,7 +80,7 @@
throws Exception
{
m_keepRunning = false;
- m_monitorThread.join();
+ m_monitorThread.interrupt();
}
public final void run()
--
.....
,,$$$$$$$$$, Marcus Crafter
;$' '$$$$: Computer Systems Engineer
$: $$$$: ManageSoft GmbH
$ o_)$$$: 82-84 Mainzer Landstrasse
;$, _/\ &&:' 60327 Frankfurt Germany
' /( &&&
\_&&&&'
&&&&.
&&&&&&&:
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>