withContext

open suspend override fun <R> withContext(action: suspend (AttachmentContext) -> R): R(source)

Executes a callback with an exclusive lock on all attachment operations. This helps prevent race conditions between different updates.