thread

Platform and version requirements: JVM (1.0)
fun thread(
    start: Boolean = true, 
    isDaemon: Boolean = false, 
    contextClassLoader: ClassLoader? = null, 
    name: String? = null, 
    priority: Int = -1, 
    block: () -> Unit
): Thread

Creates a thread that runs the specified block of code.

Parameters

start - if true, the thread is immediately started.

isDaemon - if true, the thread is created as a daemon thread. The Java Virtual Machine exits when the only threads running are all daemon threads.

contextClassLoader - the class loader to use for loading classes and resources in this thread.

name - the name of the thread.

priority - the priority of the thread.

© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.concurrent/thread.html