Partial migration to M5
This commit is contained in:
parent
b8e7569e56
commit
1bf0fe4448
23 changed files with 88 additions and 105 deletions
|
|
@ -81,25 +81,6 @@ class Dispatcher(
|
|||
}
|
||||
}
|
||||
|
||||
override def internalBlockingCall[T](awaitable: Awaitable[T], atMost: Duration): T = {
|
||||
scala.concurrent.impl.InternalFutureUtil.releaseFutureStack(this)
|
||||
|
||||
executorService.executor match {
|
||||
case fj: ForkJoinPool ⇒
|
||||
val result = new AtomicReference[Option[T]](None)
|
||||
ForkJoinPool.managedBlock(new ForkJoinPool.ManagedBlocker {
|
||||
def block(): Boolean = {
|
||||
result.set(Some(awaitable.result(atMost)(scala.concurrent.impl.InternalFutureUtil.canAwaitEvidence)))
|
||||
true
|
||||
}
|
||||
def isReleasable = result.get.isDefined
|
||||
})
|
||||
result.get.get // Exception intended if None
|
||||
case _ ⇒
|
||||
awaitable.result(atMost)(scala.concurrent.impl.InternalFutureUtil.canAwaitEvidence)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL USE ONLY
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue