Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function appTask()
- local app-list = {}
- while true do
- local evt = {os.pullEventRaw}
- if evt[1] == "openApp" then
- local co = {co=coroutine.create(appEngine.launch)}
- co.trg = coroutine.resume(co.co,evt[2])
- app-list[#app-list+1] = co
- else
- local co = app-list[#app-list]
- if co.trg == nil or co.trg == evt[1] or evt[1] == "terminate" then
- co.trg = coroutine.resume(co.co)
- end
- end
- if coroutine.status(app-list[#app-list].co) == "dead" then
- app-list[#app-list] = nil
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment