You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cancellation support for LimitedConcurrencyLevelTaskScheduler, #1253 (#1275)
* Cancellation support for LimitedConcurrencyLevelTaskScheduler, #1253
* Remove CancelAsync that is not available on .NET Framework
* Throw on QueueTask after shutdown in LimitedConcurrencyLevelTaskScheduler, #1253
Match Java's ExecutorService.shutdown() RejectedExecutionException semantics
instead of silently dropping post-shutdown submissions, which would leave
awaiters hanging on a Task that never completes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Optimize cleanup of cancellation token source
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
//ex = new ThreadPoolExecutor(threads, threads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<IThreadRunnable>(), new NamedThreadFactory("LuceneTestCase"));
varexecutor=newLimitedConcurrencyLevelTaskScheduler(numThreads);// LUCENENET NOTE: Not sure why in Java they decided to pass the max concurrent threads as all of the threads, but this demonstrates how to use a custom TaskScheduler in .NET.
475
+
476
+
// LUCENENET NOTE: Not sure why in Java they decided to pass the max concurrent threads as all of the threads, but this demonstrates how to use a custom TaskScheduler in .NET.
477
+
// LUCENENET NOTE: This cancellation token/source is intentionally separate from the one below, because it is solely used as an equivalent
478
+
// to ExecutorService.shutdown(), which just stops queueing new tasks.
TaskSchedulerservice=newLimitedConcurrencyLevelTaskScheduler(4);// LUCENENET NOTE: intentionally NOT passing cts.Token here since that parameter is for shutdown only, and that's not what we're testing
0 commit comments