Deprecate Int.latch and Int.indices extensions.

This commit is contained in:
Ilya Gorbunov
2015-04-15 19:02:31 +03:00
parent e9fe91ad2e
commit b2b98502e9
2 changed files with 2 additions and 0 deletions
@@ -72,6 +72,7 @@ public val Collection<*>.indices: IntRange
/**
* Returns an [IntRange] that starts with zero and ends at the value of this number but does not include it.
*/
deprecated("Use 0..n-1 range instead.")
public val Int.indices: IntRange
get() = 0..this - 1
@@ -58,6 +58,7 @@ public inline fun <T> ReentrantReadWriteLock.write(action: () -> T): T {
*
* @return the return value of the action.
*/
deprecated("Use CountDownLatch(Int) instead and await it manually.")
public fun <T> Int.latch(operation: CountDownLatch.() -> T): T {
val latch = CountDownLatch(this)
val result = latch.operation()