W3cubDocs

/Kotlin

Package kotlin.concurrent

Utility functions for concurrent programming.

Extensions for External Classes

Platform and version requirements: JVM (1.0)

java.lang.ThreadLocal

Platform and version requirements: JVM (1.0)

java.util.concurrent.locks.Lock

Platform and version requirements: JVM (1.0)

java.util.concurrent.locks.ReentrantReadWriteLock

Platform and version requirements: JVM (1.0)

java.util.Timer

Functions

Platform and version requirements: JVM (1.0)

fixedRateTimer

Creates a timer that executes the specified action periodically, starting after the specified initialDelay (expressed in milliseconds) and with the interval of period milliseconds between the start of the previous task and the start of the next one.

fun fixedRateTimer(
    name: String? = null, 
    daemon: Boolean = false, 
    initialDelay: Long = 0.toLong(), 
    period: Long, 
    action: TimerTask.() -> Unit
): Timer

Creates a timer that executes the specified action periodically, starting at the specified startAt date and with the interval of period milliseconds between the start of the previous task and the start of the next one.

fun fixedRateTimer(
    name: String? = null, 
    daemon: Boolean = false, 
    startAt: Date, 
    period: Long, 
    action: TimerTask.() -> Unit
): Timer
Platform and version requirements: JVM (1.0)

thread

Creates a thread that runs the specified block of code.

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

timer

Creates a timer that executes the specified action periodically, starting after the specified initialDelay (expressed in milliseconds) and with the interval of period milliseconds between the end of the previous task and the start of the next one.

fun timer(
    name: String? = null, 
    daemon: Boolean = false, 
    initialDelay: Long = 0.toLong(), 
    period: Long, 
    action: TimerTask.() -> Unit
): Timer

Creates a timer that executes the specified action periodically, starting at the specified startAt date and with the interval of period milliseconds between the end of the previous task and the start of the next one.

fun timer(
    name: String? = null, 
    daemon: Boolean = false, 
    startAt: Date, 
    period: Long, 
    action: TimerTask.() -> Unit
): Timer
Platform and version requirements: JVM (1.0)

timerTask

Wraps the specified action in a TimerTask.

fun timerTask(action: TimerTask.() -> Unit): TimerTask

© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.concurrent/index.html