Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val context1 = Executors.newFixedThreadPool(2).asCoroutineDispatcher()
- val context2 = newFixedThreadPoolContext(2, "Fixed")
- val context1 = Executors.newFixedThreadPool(2).asCoroutineDispatcher()
- repeat(4) {
- launch {
- withContext(context1) {
- Thread.sleep(2000)
- }
- }
- }
- context1.close()
Add Comment
Please, Sign In to add comment