lock

fun lock()

Acquires the lock. If the lock is already held by another thread, the current thread will block until it can acquire the lock.