title: DynamicVariable not working with Future
body: <p>The following code:</p>
  
  <pre><code>import scala.concurrent.{Await, Future}
  import scala.concurrent.duration.Duration
  import scala.util.DynamicVariable
  import scala.concurrent.ExecutionContext.Implicits.global
  
  object Main {
    def main(args: Array[String]) = {
      val a = new DynamicVariable(1)
      a.withValue(2) {
        println(a.value)
        Await.result(Future(println(a.value)), Duration.Inf)
      }
    }
  }
  </code></pre>
  
  <p>is printing:</p>
  
  <pre><code>2
  1
  </code></pre>
  
  <p>But DynamicVariable is relying on <code>InheritableThreadLocal</code> which says in the doc:</p>
  
  <blockquote>
    <p>This class extends ThreadLocal to provide inheritance of
    values from parent thread to child thread: when a child thread is
    created, the child receives initial values for all inheritable
    thread-local variables for which the parent has values.</p>
  </blockquote>
  
  <p>Does this means InheritableThreadLocal is actually not working?</p>