diff options
author | Viktor Klang <viktor.klang@gmail.com> | 2013-05-08 15:49:13 +0200 |
---|---|---|
committer | Viktor Klang <viktor.klang@gmail.com> | 2013-05-10 00:18:51 +0200 |
commit | b32d294e14615bea0c062dd61350f8ab6a05b8dc (patch) | |
tree | c504926ef9751dd4ec1119a747ce55daab275103 /src/library | |
parent | 5c77e01794434b2fa01a1bd250c08198c31796e3 (diff) | |
download | scala-b32d294e14615bea0c062dd61350f8ab6a05b8dc.tar.gz scala-b32d294e14615bea0c062dd61350f8ab6a05b8dc.tar.bz2 scala-b32d294e14615bea0c062dd61350f8ab6a05b8dc.zip |
SI-7383 - Call ExecutionContext.prepare in Future.apply to allow for capturing local context like ThreadLocals and then re-establishing them prior to execution, as per intention of EC.prepare
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/concurrent/impl/Future.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/concurrent/impl/Future.scala b/src/library/scala/concurrent/impl/Future.scala index 8c2a77c75f..89d10e5c47 100644 --- a/src/library/scala/concurrent/impl/Future.scala +++ b/src/library/scala/concurrent/impl/Future.scala @@ -28,7 +28,7 @@ private[concurrent] object Future { def apply[T](body: =>T)(implicit executor: ExecutionContext): scala.concurrent.Future[T] = { val runnable = new PromiseCompletingRunnable(body) - executor.execute(runnable) + executor.prepare.execute(runnable) runnable.promise.future } } |