Skip to content

Commit 0c7a912

Browse files
committed
Updated documentation of Flag.set
1 parent 3c12b9b commit 0c7a912

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

util/src/commonMain/kotlin/Flags.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ public inline fun Flag.ifSet(block: () -> Unit) {
5454
* If this [Flag] is not set, executes the given [action],
5555
* and if it succeeds, [set]s the flag.
5656
*
57+
* This function is not thread-safe.
58+
* Use [setWithLock] instead if you don't want [action] to execute twice.
59+
*
5760
* @return the thrown exception, if any.
5861
* @since 0.0.1-alpha.4
59-
* @see setWithLock
6062
*/
6163
@OptIn(ExperimentalContracts::class)
6264
public inline fun Flag.set(action: () -> Unit): Throwable? {

0 commit comments

Comments
 (0)