Added comment about use of Semaphore and CountDownLatch

This commit is contained in:
rick.parker 2016-05-24 16:27:39 +01:00
parent 4c75effe8c
commit 7982902e38

View File

@ -32,6 +32,9 @@ import kotlin.concurrent.withLock
* to be temporary. In addition, it's enitrely possible to envisage a time when we want public [ProtocolLogic]
* implementations to be able to wait for some condition to become true outside of message send/receive. At that point
* we may revisit this implementation and indeed the whole model for this, when we understand that requirement more fully.
*
* TODO: We should consider using a [Semaphore] or [CountDownLatch] here to make it a little easier to understand, but it seems
* as though the current version of Qasar does not support suspending on either of their implementations.
*/
class FiberBox<T>(private val content: T, private val lock: Lock = ReentrantLock()) {
private var mutated: SettableFuture<Boolean>? = null