Deprecate Int.latch and Int.indices extensions.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user