isLocked

suspend fun isLocked(key: K): Boolean

Returns true while some caller holds the mutex for key.

The answer is a snapshot; the lock state may change immediately after this function returns.

Cancellation: waiting for the internal map lock is cancellable and rethrows.