Drop deprecated threading extensions.

This commit is contained in:
Ilya Gorbunov
2015-07-22 19:01:05 +03:00
parent 850c1518c8
commit ee46ec1126
@@ -12,54 +12,6 @@ import java.util.concurrent.Future
public val currentThread: Thread
get() = Thread.currentThread()
/**
* Exposes the name of this thread as a property.
*/
@Deprecated("Is replaced with automatic synthetic extension", ReplaceWith("name"), level = DeprecationLevel.HIDDEN)
public var Thread.name: String
get() = getName()
set(value) {
setName(value)
}
/**
* Exposes the daemon flag of this thread as a property.
* The Java Virtual Machine exits when the only threads running are all daemon threads.
*/
@Deprecated("Use synthetic extension property isDaemon instead.", ReplaceWith("this.isDaemon"))
public var Thread.daemon: Boolean
get() = isDaemon()
set(value) {
setDaemon(value)
}
/**
* Exposes the alive state of this thread as a property.
*/
@Deprecated("Use synthetic extension property isAlive instead.", ReplaceWith("this.isAlive"))
public val Thread.alive: Boolean
get() = isAlive()
/**
* Exposes the priority of this thread as a property.
*/
@Deprecated("Is replaced with automatic synthetic extension", ReplaceWith("priority"), level = DeprecationLevel.HIDDEN)
public var Thread.priority: Int
get() = getPriority()
set(value) {
setPriority(value)
}
/**
* Exposes the context class loader of this thread as a property.
*/
@Deprecated("Is replaced with automatic synthetic extension", ReplaceWith("contextClassLoader"), level = DeprecationLevel.HIDDEN)
public var Thread.contextClassLoader: ClassLoader?
get() = getContextClassLoader()
set(value) {
setContextClassLoader(value)
}
/**
* Creates a thread that runs the specified [block] of code.
*
@@ -104,21 +56,3 @@ public inline fun <T: Any> ThreadLocal<T>.getOrSet(default: () -> T): T {
// TODO: replace let with apply or touch
return get() ?: default().let { set(it); it }
}
/**
* Allows you to use the executor as a function to
* execute the given block on the [Executor].
*/
@Deprecated("Use Executor.execute(Runnable) instead.") // do not specify ReplaceWith("execute(action)") due to KT-8597
public operator fun Executor.invoke(action: () -> Unit) {
execute(action)
}
/**
* Allows you to use the executor service as a function to
* execute the given block on the [ExecutorService].
*/
@Deprecated("Use ExecutorService.submit(Callable) instead.") // do not specify ReplaceWith("submit(action)") due to KT-8597
public operator fun <T> ExecutorService.invoke(action: () -> T): Future<T> {
return submit(action)
}