fork download
  1. child_coro = "nothing"
  2.  
  3. function child_func()
  4. print(2)
  5. coroutine.yield()
  6. print(2)
  7. end
  8.  
  9. function parent_func()
  10. print(1)
  11.  
  12. child_coro = coroutine.create(child_func)
  13. coroutine.resume(child_coro)
  14.  
  15. coroutine.yield()
  16. print(1)
  17. end
  18.  
  19. parent_coro = coroutine.create(parent_func)
  20. coroutine.resume(parent_coro)
  21.  
  22. coroutine.resume(child_coro)
  23.  
  24.  
Success #stdin #stdout 0s 2836KB
stdin
Standard input is empty
stdout
1
2
2