writeLock

open fun writeLock(action: () -> Unit)

Lock metadata while performing an action that changes metadata. To separate the locking and unlocking steps, see {@link com.sap.cloud.mobile.kotlin.odata.MetadataLock#mutex MetadataLock.mutex}, ReadWriteLock.beginWrite and ReadWriteLock.endWrite. Note: If a thread tries to acquire a write lock while already holding a (read or write) lock, the thread will hang.

Parameters

action

Action to perform while an exclusive write lock is held.