Ir al contenido

Busy Loop In Coroutine (ARCH8033)

Esta página aún no está disponible en tu idioma.

Key kotlin.async.busy-loop-in-coroutine · Severity warning · Category async

Flags a while(true) loop inside launch / async with no delay, yield or suspension - it never lets the dispatcher run anything else.

launch { while (true) { if (ready()) break } }
launch { while (isActive && !ready()) { delay(50) } }

Suspend inside the loop (delay, yield, a channel receive) so the thread is released.