in experimental/lwjgl-integration/src/main/kotlin/GlfwCoroutineDispatcher.kt [10:24]
fun runLoop() {
while (!isStopped) {
synchronized(tasks) {
tasksCopy.addAll(tasks)
tasks.clear()
}
for (runnable in tasksCopy) {
if (!isStopped) {
runnable.run()
}
}
tasksCopy.clear()
GLFW.glfwWaitEvents()
}
}