Skip to content

Commit 23eb49a

Browse files
committed
Update documentation for Mutex.withLock to be consistent with Mutex.lock
Fixes #940
1 parent 37f1b97 commit 23eb49a

File tree

1 file changed

+2
-1
lines changed
  • kotlinx-coroutines-core/common/src/sync

1 file changed

+2
-1
lines changed

kotlinx-coroutines-core/common/src/sync/Mutex.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ public fun Mutex(locked: Boolean = false): Mutex =
100100
/**
101101
* Executes the given [action] under this mutex's lock.
102102
*
103-
* @param owner Optional owner token for debugging.
103+
* @param owner Optional owner token for debugging. When `owner` is specified (non-null value) and this mutex
104+
* is already locked with the same token (same identity), this function throws [IllegalStateException].
104105
*
105106
* @return the return value of the action.
106107
*/

0 commit comments

Comments
 (0)