Advanced Kotlin
Q78 / 100

What is the Mutex in Kotlin coroutines and how does it differ from synchronized?

Correct! Well done.

Incorrect.

The correct answer is B) Mutex is a coroutine-aware mutual exclusion lock that suspends (not blocks) the waiting coroutine

B

Correct Answer

Mutex is a coroutine-aware mutual exclusion lock that suspends (not blocks) the waiting coroutine

Explanation

synchronized blocks the thread while waiting for the lock. Mutex.withLock { } suspends the coroutine at lock acquisition, freeing the thread for other coroutines.

Progress
78/100