diff --git a/CHANGELOG.md b/CHANGELOG.md index 728415436df..999a3c5b14d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.25.4 +* `Coroutines`: + * Add `SmartKeyRWLocker.withWriteLocks` extension with vararg keys + ## 0.25.3 * `Coroutines`: diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartKeyRWLocker.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartKeyRWLocker.kt index 407eec5add4..1f92ed2651b 100644 --- a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartKeyRWLocker.kt +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartKeyRWLocker.kt @@ -221,4 +221,6 @@ suspend inline fun SmartKeyRWLocker.withWriteLocks(keys: Iterable, unlockWrite(it) } } -} \ No newline at end of file +} + +suspend inline fun SmartKeyRWLocker.withWriteLocks(vararg keys: T, action: () -> R): R = withWriteLocks(keys.asIterable(), action)