[FIR] Fix false positive "suspension point is inside a critical section"

^KT-55072 Fixed
This commit is contained in:
Ivan Kochurkin
2023-07-17 19:13:32 +02:00
committed by Space Team
parent 30c00f7983
commit d8ccf21894
7 changed files with 105 additions and 20 deletions
@@ -0,0 +1,29 @@
// FIR_IDENTICAL
// ISSUE: KT-55072
import java.util.concurrent.locks.ReentrantLock
import kotlin.concurrent.withLock
class Player
{
fun play() {
ReentrantLock().withLock {
launch {
pumpEvents()
}
suspend fun launch2() {
pumpEvents()
}
suspend {
pumpEvents()
}
run {
<!ILLEGAL_SUSPEND_FUNCTION_CALL!>pumpEvents<!>()
}
}
}
private suspend fun pumpEvents() {}
private fun launch(block: suspend Any.() -> Unit) {}
}