Since I couldn't find a standard implementation of it I created this little class, but I think something simple as this should exist somewhere already:

```
class ReturnValue {
    private var value = false

    private val latch = new java.util.concurrent.CountDownLatch(1)

    def setValue(aValue: Boolean) {
        value = aValue
        latch.countDown()
    }
    def getValue() = {
        latch.await
        value
    }
}

```

The purpose of it is to exchange a value between two threads (main thread + EDT in my case). From the code using the getValue() method it looks almost like a Future, but the Future implementations I found expect the caller to provide the code to be executed, which doesn't work in my case.

So my questions are:

* Is there a name for such a thingy?
* Is there a standard implementation for it in java or scala?
* Is my implementation even correct?