July 2018
Intermediate to advanced
242 pages
8h 6m
English
Let's declare a lock() function with two arguments—an instance of the Lock interface and the function to be invoked after the lock is acquired:
inline fun performHavingLock(lock: Lock, task: () -> Unit) { lock.lock() try { task() } finally { lock.unlock() }}
Read now
Unlock full access