Exemplo n.º 1
0
		static BatchingProgressMonitor()
		{
			// To support garbage collection, start our thread but
			// swap out the thread factory. When our class is GC'd
			// the alarmQueueKiller will finalize and ask the executor
			// to shutdown, ending the worker.
			//
			int threads = 1;
			alarmQueue = new ScheduledThreadPoolExecutor(threads, new _ThreadFactory_66());
			alarmQueue.SetContinueExistingPeriodicTasksAfterShutdownPolicy(false);
			alarmQueue.SetExecuteExistingDelayedTasksAfterShutdownPolicy(false);
			alarmQueue.PrestartAllCoreThreads();
			// Now that the threads are running, its critical to swap out
			// our own thread factory for one that isn't in the ClassLoader.
			// This allows the class to GC.
			//
			alarmQueue.SetThreadFactory(Executors.DefaultThreadFactory());
			alarmQueueKiller = new _object_87();
		}
Exemplo n.º 2
0
        static BatchingProgressMonitor()
        {
            // To support garbage collection, start our thread but
            // swap out the thread factory. When our class is GC'd
            // the alarmQueueKiller will finalize and ask the executor
            // to shutdown, ending the worker.
            //
            int threads = 1;

            alarmQueue = new ScheduledThreadPoolExecutor(threads, new _ThreadFactory_66());
            alarmQueue.SetContinueExistingPeriodicTasksAfterShutdownPolicy(false);
            alarmQueue.SetExecuteExistingDelayedTasksAfterShutdownPolicy(false);
            alarmQueue.PrestartAllCoreThreads();
            // Now that the threads are running, its critical to swap out
            // our own thread factory for one that isn't in the ClassLoader.
            // This allows the class to GC.
            //
            alarmQueue.SetThreadFactory(Executors.DefaultThreadFactory());
            alarmQueueKiller = new _object_87();
        }