Guest User

Untitled

a guest
Dec 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. val context1 = Executors.newFixedThreadPool(2).asCoroutineDispatcher()
  2. val context2 = newFixedThreadPoolContext(2, "Fixed")
  3.  
  4. val context1 = Executors.newFixedThreadPool(2).asCoroutineDispatcher()
  5.  
  6. repeat(4) {
  7. launch {
  8. withContext(context1) {
  9. Thread.sleep(2000)
  10. }
  11. }
  12. }
  13.  
  14. context1.close()
Add Comment
Please, Sign In to add comment