Advertisement
Guest User

Untitled

a guest
May 12th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. Nature.Terminal.Write("Setting up kernel threads... ", Nature.Terminal.Color.LightGray);
  2.         local function TestFunc()
  3.             while true do
  4.                 local Event = coroutine.yield();
  5.                 print("TestFunc says: Next event is: " .. Event);
  6.             end
  7.         end
  8.  
  9.         local function TestFunc2()
  10.             while true do
  11.                 local Event = coroutine.yield();
  12.                 print("TestFunc2 says: Got a " .. Event .. " event !");
  13.             end
  14.         end
  15.  
  16.         Nature.Thread.NewThread(TestFunc);
  17.         Nature.Thread.NewThread(TestFunc2);
  18.  
  19.         Nature.Terminal.WriteLine("done", Nature.Terminal.Color.Green);
  20.  
  21.         Nature.Thread.Switch();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement