fixed some more inference bugs

This commit is contained in:
sergeych committed 2026-04-20 12:23:17 +03:00
1 parent a8f73dc8bd
commit 6ba128f7ba
2 files changed
+15 -6

No files matched your search

+4 -5
View File
@@ -545,8 +545,7 @@ class StackTraceEntry(
}
// Private helper: starts one LaunchPool worker coroutine for the given queue.
// Defined outside LaunchPool so the global `launch` is not shadowed by the method.
private fun _launchPoolWorker(q) {
val ch = q as Channel
private fun _launchPoolWorker(ch: Channel): Deferred {
launch {
var task = ch.receive()
while (task != null) {
@@ -618,7 +617,7 @@ class LaunchPool(maxWorkers, maxQueueSize = Channel.UNLIMITED) {
*/
fun cancel() {
closeQueue()
workers.forEach { (it as Deferred).cancel() }
workers.forEach { it.cancel() }
}
/*
@@ -628,7 +627,7 @@ class LaunchPool(maxWorkers, maxQueueSize = Channel.UNLIMITED) {
*/
fun cancelAndJoin() {
closeQueue()
workers.forEach { (it as Deferred).cancel() }
workers.forEach { it.cancel() }
}
/*
@@ -639,7 +638,7 @@ class LaunchPool(maxWorkers, maxQueueSize = Channel.UNLIMITED) {
fun closeAndJoin() {
closeQueue()
for (w in workers) {
(w as Deferred).await()
w.await()
}
}
}