package Ġcom . se an sh ub in . code . sync . domain Ċ Ċ import Ġkotlinx . coroutines . Coroutine Dispatcher Ċ import Ġkotlinx . coroutines . as Coroutine Dispatcher Ċ import Ġjava . util . concurrent . Executors Ċ Ċ class ĠCor outines Dispatcher Lifecycle Impl Ġ: ĠCor outine Dispatcher Lifecycle Ġ{ ĊĠ Ġoverride Ġfun Ġ< T > Ġwith Coroutine Dispatcher ( f : Ġ( Coroutine Dispatcher ) Ġ-> ĠT ): ĠT Ġ{ ĊĠĠĠ Ġval Ġthread Pool Ġ= ĠExec utors . new Cached ThreadPool () ĊĠĠĠ Ġval Ġcoroutine Dispatcher : ĠCor outine Dispatcher Ġ= Ġthread Pool . as Coroutine Dispatcher () ĊĠĠĠ Ġval Ġresult Ġ= Ġf ( coroutine Dispatcher ) ĊĠĠĠ Ġthread Pool . shutdown () ĊĠĠĠ Ġreturn Ġresult ĊĠ Ġ} Ċ }