Queue workItems = new Queue ();
AutoResetEvent threadDone = new AutoResetEvent (false);
ArrayList runningThreads = new ArrayList ();
+
+#if TARGET_JVM
+ volatile
+#endif
bool stopped = false;
static object globalLock = new object ();
threadDone.Set ();
workItems.Clear ();
foreach (Thread t in runningThreads)
+#if !TARGET_JVM
t.Abort ();
+#else
+ t.Interrupt();
+#endif
runningThreads.Clear ();
}
if (this == sharedPool)
void PoolThread ()
{
+#if !TARGET_JVM
while (true) {
+#else
+ while (!stopped)
+ {
+#endif
ThreadStart work = null;
do {
lock (workItems) {
} while (work == null);
try {
work ();
- } catch {
- // Can't do anything with the exception
+ }
+ catch (Exception ex)
+ {
+#if DEBUG
+ Console.WriteLine("The exception was caught during RemotingThreadPool.PoolThread - work: {0}, {1}", ex.GetType(), ex.Message);
+#endif
}
}
}