Skip to content

Commit 745fca9

Browse files
committed
Update documentation for Mutex.withLock to be consistent with Mutex.lock
Fixes #940
1 parent bc3ce4b commit 745fca9

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

+2-1
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)