diff --git a/LICENSE b/LICENSE index 3b661ec..f0e3a38 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/changes.md b/changes.md index 0d035fe..ec270c6 100644 --- a/changes.md +++ b/changes.md @@ -1,7 +1,7 @@ # Changelog Table of contents --- -[Update 15.1.0 - Hold the thread!](#update-1510---hold-the-thread)
[Update 15.0.0 - The art of faking it](#update-1500---the-art-of-faking-it)
[Update 14.2.0 - Bloatware Removed](#update-1420---bloatware-removed)
[Update 14.1.0 - A whole new world of possibilities](#update-1410---a-whole-new-world-of-possibilities)
[Update 14.0.0 - Consistency, Additions and Stability](#update-1400---consistency-additions-and-stability)
[Update 13.1.0 - Bug fixes and features added](#update-1310---bug-fixes-and-features-added)
[Update 13.0.0 - Added some documentation, and some new features too check it out!](#update-1300---added-some-documentation-and-some-new-features-too-check-it-out)
[Update 12.2.2 - Time for some more bug fixes!](#update-1222---time-for-some-more-bug-fixes)
[Update 12.2.1 - Time for some bug fixes!](#update-1221---time-for-some-bug-fixes)
[Update 12.2.0 - The chains of binding](#update-1220---the-chains-of-binding)
[Update 12.1.0 - Threads just can't hold on anymore](#update-1210---threads-just-cant-hold-on-anymore)
[Update: 12.0.0 - Big update (Lots of additions some changes)](#update-1200---big-update-lots-of-additions-some-changes)
[Update: 1.11.1 - Small Clarification on Love](#update-1111---small-clarification-on-love)
[Update: 1.11.0](#update-1110)
[Update: 1.10.0](#update-1100)
[Update: 1.9.2](#update-192)
[Update: 1.9.1 - Threads can now argue](#update-191---threads-can-now-argue)
[Update: 1.9.0](#update-190)
[Update: 1.8.7](#update-187)
[Update: 1.8.6](#update-186)
[Update: 1.8.5](#update-185)
[Update: 1.8.4](#update-184)
[Update: 1.8.3 - Mainloop recieves some needed overhauling](#update-183---mainloop-recieves-some-needed-overhauling)
[Update: 1.8.2](#update-182)
[Update: 1.8.1](#update-181)
[Update: 1.7.6](#update-176)
[Update: 1.7.5](#update-175)
[Update: 1.7.4](#update-174)
[Update: 1.7.3](#update-173)
[Update: 1.7.2](#update-172)
[Update: 1.7.1 - Bug Fixes Only](#update-171---bug-fixes-only)
[Update: 1.7.0 - Threading the systems](#update-170---threading-the-systems)
[Update: 1.6.0](#update-160)
[Update: 1.5.0](#update-150)
[Update: 1.4.1 (4/10/2017) - First Public release of the library](#update-141-4102017---first-public-release-of-the-library)
[Update: 1.4.0 (3/20/2017)](#update-140-3202017)
[Update: 1.3.0 (1/29/2017)](#update-130-1292017)
[Update: 1.2.0 (12.31.2016)](#update-120-12312016)
[Update: 1.1.0](#update-110)
[Update: 1.0.0](#update-100)
[Update: 0.6.3](#update-063)
[Update: 0.6.2](#update-062)
[Update: 0.6.1-6](#update-061-6)
[Update: 0.5.1-6](#update-051-6)
[Update: 0.4.1](#update-041)
[Update: 0.3.0 - The update that started it all](#update-030---the-update-that-started-it-all)
[Update: EventManager 2.0.0](#update-eventmanager-200)
[Update: EventManager 1.2.0](#update-eventmanager-120)
[Update: EventManager 1.1.0](#update-eventmanager-110)
[Update: EventManager 1.0.0 - Error checking](#update-eventmanager-100---error-checking)
[Version: EventManager 0.0.1 - In The Beginning things were very different](#version-eventmanager-001---in-the-beginning-things-were-very-different) +[Update 15.2.0 - Upgrade Complete](#update-1520---upgrade-complete)
[Update 15.1.0 - Hold the thread!](#update-1510---hold-the-thread)
[Update 15.0.0 - The art of faking it](#update-1500---the-art-of-faking-it)
[Update 14.2.0 - Bloatware Removed](#update-1420---bloatware-removed)
[Update 14.1.0 - A whole new world of possibilities](#update-1410---a-whole-new-world-of-possibilities)
[Update 14.0.0 - Consistency, Additions and Stability](#update-1400---consistency-additions-and-stability)
[Update 13.1.0 - Bug fixes and features added](#update-1310---bug-fixes-and-features-added)
[Update 13.0.0 - Added some documentation, and some new features too check it out!](#update-1300---added-some-documentation-and-some-new-features-too-check-it-out)
[Update 12.2.2 - Time for some more bug fixes!](#update-1222---time-for-some-more-bug-fixes)
[Update 12.2.1 - Time for some bug fixes!](#update-1221---time-for-some-bug-fixes)
[Update 12.2.0 - The chains of binding](#update-1220---the-chains-of-binding)
[Update 12.1.0 - Threads just can't hold on anymore](#update-1210---threads-just-cant-hold-on-anymore)
[Update: 12.0.0 - Big update (Lots of additions some changes)](#update-1200---big-update-lots-of-additions-some-changes)
[Update: 1.11.1 - Small Clarification on Love](#update-1111---small-clarification-on-love)
[Update: 1.11.0](#update-1110)
[Update: 1.10.0](#update-1100)
[Update: 1.9.2](#update-192)
[Update: 1.9.1 - Threads can now argue](#update-191---threads-can-now-argue)
[Update: 1.9.0](#update-190)
[Update: 1.8.7](#update-187)
[Update: 1.8.6](#update-186)
[Update: 1.8.5](#update-185)
[Update: 1.8.4](#update-184)
[Update: 1.8.3 - Mainloop recieves some needed overhauling](#update-183---mainloop-recieves-some-needed-overhauling)
[Update: 1.8.2](#update-182)
[Update: 1.8.1](#update-181)
[Update: 1.7.6](#update-176)
[Update: 1.7.5](#update-175)
[Update: 1.7.4](#update-174)
[Update: 1.7.3](#update-173)
[Update: 1.7.2](#update-172)
[Update: 1.7.1 - Bug Fixes Only](#update-171---bug-fixes-only)
[Update: 1.7.0 - Threading the systems](#update-170---threading-the-systems)
[Update: 1.6.0](#update-160)
[Update: 1.5.0](#update-150)
[Update: 1.4.1 (4/10/2017) - First Public release of the library](#update-141-4102017---first-public-release-of-the-library)
[Update: 1.4.0 (3/20/2017)](#update-140-3202017)
[Update: 1.3.0 (1/29/2017)](#update-130-1292017)
[Update: 1.2.0 (12.31.2016)](#update-120-12312016)
[Update: 1.1.0](#update-110)
[Update: 1.0.0](#update-100)
[Update: 0.6.3](#update-063)
[Update: 0.6.2](#update-062)
[Update: 0.6.1-6](#update-061-6)
[Update: 0.5.1-6](#update-051-6)
[Update: 0.4.1](#update-041)
[Update: 0.3.0 - The update that started it all](#update-030---the-update-that-started-it-all)
[Update: EventManager 2.0.0](#update-eventmanager-200)
[Update: EventManager 1.2.0](#update-eventmanager-120)
[Update: EventManager 1.1.0](#update-eventmanager-110)
[Update: EventManager 1.0.0 - Error checking](#update-eventmanager-100---error-checking)
[Version: EventManager 0.0.1 - In The Beginning things were very different](#version-eventmanager-001---in-the-beginning-things-were-very-different) # Update 15.2.0 - Upgrade Complete @@ -26,7 +26,6 @@ Added: Changed: --- - - Connection Objects now pass on the parent object if created on a multiobj. This was to allow chaining to work properly with the new update ```lua @@ -76,7 +75,6 @@ Changed: ### Developer Note: - Connections are some of the most complex objects that this library has outside of some of the system threaded stuff. I tend to add features to connection objects quite often. Just last update connections can be "added" together creating a temp connection that only triggers when all of the added connections got triggered as well. Thinking about the possibilities this could give developers using the library I had to changed the base classes to use connections. The best part about this is that connections allow for greater control over an object's events. You can add and remove events that have been connected to as well as a lot of other things. Reference the documentation [here](./Documentation.md#non-actor-connections) @@ -84,6 +82,7 @@ The best part about this is that connections allow for greater control over an o Removed: --- +Nothing Fixed: --- diff --git a/multi/compat/love2d.lua b/multi/compat/love2d.lua index f86191a..73110e3 100644 --- a/multi/compat/love2d.lua +++ b/multi/compat/love2d.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/compat/lovr.lua b/multi/compat/lovr.lua index c37906d..8c18b37 100644 --- a/multi/compat/lovr.lua +++ b/multi/compat/lovr.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/init.lua b/multi/init.lua index 3fc6ee8..1a93d1c 100644 --- a/multi/init.lua +++ b/multi/init.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -1148,81 +1148,88 @@ function thread.pushStatus(...) local t = thread.getRunningThread() t.statusconnector:Fire(...) end -function thread:newFunction(func,holdme) - local tfunc = {} - tfunc.Active = true - function tfunc:Pause() - self.Active = false - end - function tfunc:Resume() - self.Active = true - end - function tfunc:holdMe(b) - holdme = b - end - local function noWait() - return nil, "Function is paused" - end - local rets, err - local function wait(no) - if thread.isThread() and not (no) then - return multi.hold(function() - if err then - return multi.NIL, err - elseif rets then - return cleanReturns((rets[1] or multi.NIL),rets[2],rets[3],rets[4],rets[5],rets[6],rets[7],rets[8],rets[9],rets[10],rets[11],rets[12],rets[13],rets[14],rets[15],rets[16]) - end - end) - else - while not rets and not err do - multi.scheduler:Act() - end - if err then - return nil,err - end - return cleanReturns(rets[1],rets[2],rets[3],rets[4],rets[5],rets[6],rets[7],rets[8],rets[9],rets[10],rets[11],rets[12],rets[13],rets[14],rets[15],rets[16]) +function thread:newFunctionBase(generator,holdme) + return function() + local tfunc = {} + tfunc.Active = true + function tfunc:Pause() + self.Active = false end - end - tfunc.__call = function(t,...) - if not t.Active then - if holdme then - return nil, "Function is paused" + function tfunc:Resume() + self.Active = true + end + function tfunc:holdMe(b) + holdme = b + end + local function noWait() + return nil, "Function is paused" + end + local rets, err + local function wait(no) + if thread.isThread() and not (no) then + return multi.hold(function() + if err then + return multi.NIL, err + elseif rets then + return cleanReturns((rets[1] or multi.NIL),rets[2],rets[3],rets[4],rets[5],rets[6],rets[7],rets[8],rets[9],rets[10],rets[11],rets[12],rets[13],rets[14],rets[15],rets[16]) + end + end) + else + while not rets and not err do + multi.scheduler:Act() + end + if err then + return nil,err + end + return cleanReturns(rets[1],rets[2],rets[3],rets[4],rets[5],rets[6],rets[7],rets[8],rets[9],rets[10],rets[11],rets[12],rets[13],rets[14],rets[15],rets[16]) end - return { + end + tfunc.__call = function(t,...) + if not t.Active then + if holdme then + return nil, "Function is paused" + end + return { + isTFunc = true, + wait = noWait, + connect = function(f) + f(nil,"Function is paused") + end + } + end + local t = generator(...) --multi.getCurrentProcess():newThread("TempThread",func,...) + t.OnDeath(function(self,status,...) rets = {...} end) + t.OnError(function(self,e) err = e end) + if holdme then + return wait() + end + local temp = { + OnStatus = multi:newConnection(), + OnError = multi:newConnection(), + OnReturn = multi:newConnection(), isTFunc = true, - wait = noWait, + wait = wait, connect = function(f) - f(nil,"Function is paused") + local tempConn = multi:newConnection() + t.OnDeath(function(self,status,...) if f then f(...) else tempConn:Fire(...) end end) + t.OnError(function(self,err) if f then f(nil,err) else tempConn:Fire(nil,err) end end) + return tempConn end } - end - local t = multi.getCurrentProcess():newThread("TempThread",func,...) - t.OnDeath(function(self,status,...) rets = {...} end) - t.OnError(function(self,e) err = e end) - if holdme then - return wait() + t.OnDeath(function(self,status,...) temp.OnReturn:Fire(...) end) + t.OnError(function(self,err) temp.OnError:Fire(err) end) + t.linkedFunction = temp + t.statusconnector = temp.OnStatus + return temp end - local temp = { - OnStatus = multi:newConnection(), - OnError = multi:newConnection(), - OnReturn = multi:newConnection(), - isTFunc = true, - wait = wait, - connect = function(f) - local tempConn = multi:newConnection() - t.OnDeath(function(self,status,...) if f then f(...) else tempConn:Fire(...) end end) - t.OnError(function(self,err) if f then f(nil,err) else tempConn:Fire(nil,err) end end) - return tempConn - end - } - t.OnDeath(function(self,status,...) temp.OnReturn:Fire(...) end) - t.OnError(function(self,err) temp.OnError:Fire(err) end) - t.linkedFunction = temp - t.statusconnector = temp.OnStatus - return temp + setmetatable(tfunc,tfunc) + return tfunc end - setmetatable(tfunc,tfunc) - return tfunc +end +function thread:newFunction(func,holdme) + return thread:newFunctionBase(function(...) + return multi.getCurrentProcess():newThread("TempThread",func,...) + end,holdme)() end -- A cross version way to set enviroments, not the same as fenv though diff --git a/multi/integration/lanesManager/extensions.lua b/multi/integration/lanesManager/extensions.lua index d4fd404..c582c17 100644 --- a/multi/integration/lanesManager/extensions.lua +++ b/multi/integration/lanesManager/extensions.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/lanesManager/init.lua b/multi/integration/lanesManager/init.lua index 16bdcf4..9526c4f 100644 --- a/multi/integration/lanesManager/init.lua +++ b/multi/integration/lanesManager/init.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]] package.path = "?/init.lua;?.lua;" .. package.path -multi, thread = require("multi").init() -- get it all and have it on all lanes +multi, thread = require("multi"):init() -- get it all and have it on all lanes if multi.integration then -- This allows us to call the lanes manager from supporting modules without a hassle return { init = function() @@ -31,15 +31,18 @@ if multi.integration then -- This allows us to call the lanes manager from suppo } end -- Step 1 get lanes -lanes = require("lanes").configure() +lanes = require("lanes").configure({allocator="protected",verbose_errors=""}) multi.SystemThreads = {} multi.isMainThread = true + function multi:canSystemThread() return true end + function multi:getPlatform() return "lanes" end + -- Step 2 set up the Linda objects local __GlobalLinda = lanes.linda() -- handles global stuff local __SleepingLinda = lanes.linda() -- handles sleeping stuff @@ -50,118 +53,50 @@ multi:newLoop(function() print(unpack(data)) end end) -local GLOBAL,THREAD = require("multi.integration.lanesManager.threads").init(__GlobalLinda,__SleepingLinda) -local threads = {} +local GLOBAL,THREAD = {},{}-- require("multi.integration.lanesManager.threads").init(__GlobalLinda,__SleepingLinda) local count = 1 local started = false local livingThreads = {} +local threads = {} function THREAD:newFunction(func,holdme) - local tfunc = {} - tfunc.Active = true - function tfunc:Pause() - self.Active = false - end - function tfunc:Resume() - self.Active = true - end - function tfunc:holdMe(b) - holdme = b - end - local function noWait() - return nil, "Function is paused" - end - local rets, err - local function wait(no) - if thread.isThread() and not (no) then - return multi.hold(function() - if err then - return nil, err - elseif rets then - return unpack(rets) - end - end) - else - while not rets and not err do - multi.scheduler:Act() - end - if err then - return nil,err - end - return unpack(rets) - end - end - tfunc.__call = function(t,...) - if not t.Active then - if holdme then - return nil, "Function is paused" - end - return { - isTFunc = true, - wait = noWait, - connect = function(f) - f(nil,"Function is paused") - end - } - end - local t = multi:newSystemThread("SystemThreadedFunction",func,...) - t.OnDeath(function(self,...) rets = {...} end) - t.OnError(function(self,e) err = e end) - if holdme then - return wait() - end - local temp = { - OnStatus = multi:newConnection(), - OnError = multi:newConnection(), - OnReturn = multi:newConnection(), - isTFunc = true, - wait = wait, - connect = function(f) - local tempConn = multi:newConnection() - t.OnDeath(function(self,...) if f then f(...) else tempConn:Fire(...) end end) - t.OnError(function(self,err) if f then f(nil,err) else tempConn:Fire(nil,err) end end) - return tempConn - end - } - t.OnDeath(function(self,...) temp.OnReturn:Fire(...) end) - t.OnError(function(self,err) temp.OnError:Fire(err) end) - t.linkedFunction = temp - t.statusconnector = temp.OnStatus - return temp - end - setmetatable(tfunc,tfunc) - return tfunc + return thread:newFunctionBase(function(...) + return multi:newSystemThread("TempSystemThread",func,...) + end,holdme)() end function multi:newSystemThread(name, func, ...) - multi.InitSystemThreadErrorHandler() - rand = math.random(1, 10000000) + --multi.InitSystemThreadErrorHandler() + local rand = math.random(1, 10000000) + local return_linda = lanes.linda() local c = {} - local __self = c c.name = name c.Name = name c.Id = count c.loadString = {"base","package","os","io","math","table","string","coroutine"} livingThreads[count] = {true, name} + c.returns = return_linda c.Type = "sthread" c.creationTime = os.clock() c.alive = true c.priority = THREAD.Priority_Normal - local args = {...} - multi:newThread(function() - c.thread = lanes.gen(table.concat(c.loadString,","), - { - globals={ -- Set up some globals - THREAD_NAME=name, - THREAD_ID=count, - THREAD = THREAD, - GLOBAL = GLOBAL, - _Console = __ConsoleLinda - }, - priority=c.priority - },func)(unpack(args)) - thread.kill() - end) + c.thread = lanes.gen("*", + { + globals={ -- Set up some globals + THREAD_NAME = name, + THREAD_ID = count, + THREAD = THREAD, + GLOBAL = GLOBAL, + _Console = __ConsoleLinda + }, + priority=c.priority + },function(...) + local has_error = true + return_linda:set("returns",{func(...)}) + has_error = false + --error("thread killed") + print("Thread ending") + end)(...) count = count + 1 function c:kill() self.thread:cancel() @@ -171,61 +106,56 @@ function multi:newSystemThread(name, func, ...) table.insert(multi.SystemThreads, c) c.OnDeath = multi:newConnection() c.OnError = multi:newConnection() - GLOBAL["__THREADS__"] = livingThreads + --GLOBAL["__THREADS__"] = livingThreads return c end -local function detectLuaError(str) - return type(str)=="string" and str:match("%.lua:%d*:") -end - -local function tableLen(tab) - local len = 0 - for i,v in pairs(tab) do - len = len + 1 - end - return len -end - function multi.InitSystemThreadErrorHandler() if started == true then return end started = true - multi:newThread("ThreadErrorHandler",function() + multi:newThread("SystemThreadScheduler",function() local threads = multi.SystemThreads while true do - thread.sleep(.1) -- switching states often takes a huge hit on performance. half a second to tell me there is an error is good enough. + thread.sleep(.01) -- switching states often takes a huge hit on performance. half a second to tell me there is an error is good enough. for i = #threads, 1, -1 do - local _,data = pcall(function() - return {threads[i].thread:join(1)} - end) - local v, err, t = data[1],data[2],data[3] - if detectLuaError(err) then - if err:find("Thread was killed!\1") then - livingThreads[threads[i].Id] = {false, threads[i].Name} - threads[i].alive = false - threads[i].OnDeath:Fire(threads[i],nil,"Thread was killed!") - GLOBAL["__THREADS__"] = livingThreads - table.remove(threads, i) - else - threads[i].OnError:Fire(threads[i], err, "Error in systemThread: '" .. threads[i].name .. "' <" .. err .. ">") - threads[i].alive = false - livingThreads[threads[i].Id] = {false, threads[i].Name} - GLOBAL["__THREADS__"] = livingThreads - table.remove(threads, i) - end - elseif tableLen(data)>0 then - livingThreads[threads[i].Id] = {false, threads[i].Name} - threads[i].alive = false - threads[i].OnDeath:Fire(threads[i],unpack(data)) - GLOBAL["__THREADS__"] = livingThreads + local status = threads[i].thread.status + local temp = threads[i] + if status == "done" or temp.returns:get("returns") then + livingThreads[temp.Id] = {false, temp.Name} + temp.alive = false + temp.OnDeath:Fire(temp,nil,unpack(({temp.returns:receive(0, "returns")})[2])) + --GLOBAL["__THREADS__"] = livingThreads + --print(temp.thread:cancel(10,true)) + table.remove(threads, i) + elseif status == "running" then + -- + elseif status == "waiting" then + -- + elseif status == "error" then + livingThreads[temp.Id] = {false, temp.Name} + temp.alive = false + temp.OnError:Fire(temp,nil,unpack(temp.returns:receive(0,"returns"))) + --GLOBAL["__THREADS__"] = livingThreads + table.remove(threads, i) + elseif status == "cancelled" then + livingThreads[temp.Id] = {false, temp.Name} + temp.alive = false + temp.OnError:Fire(temp,nil,"thread_cancelled") + --GLOBAL["__THREADS__"] = livingThreads + table.remove(threads, i) + elseif status == "killed" then + livingThreads[temp.Id] = {false, temp.Name} + temp.alive = false + temp.OnError:Fire(temp,nil,"thread_killed") + --GLOBAL["__THREADS__"] = livingThreads table.remove(threads, i) end end end end).OnError(function(...) - print("Error!",...) + print(...) end) end multi.print("Integrated Lanes!") diff --git a/multi/integration/lanesManager/threads.lua b/multi/integration/lanesManager/threads.lua index 6d9d13d..04277d1 100644 --- a/multi/integration/lanesManager/threads.lua +++ b/multi/integration/lanesManager/threads.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/loveManager/extensions.lua b/multi/integration/loveManager/extensions.lua index 1673611..9424902 100644 --- a/multi/integration/loveManager/extensions.lua +++ b/multi/integration/loveManager/extensions.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/loveManager/init.lua b/multi/integration/loveManager/init.lua index 16f9b07..5cc490d 100644 --- a/multi/integration/loveManager/init.lua +++ b/multi/integration/loveManager/init.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/loveManager/threads.lua b/multi/integration/loveManager/threads.lua index a4ee947..97280c8 100644 --- a/multi/integration/loveManager/threads.lua +++ b/multi/integration/loveManager/threads.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/lovrManager/extensions.lua b/multi/integration/lovrManager/extensions.lua index d2d5143..36747ce 100644 --- a/multi/integration/lovrManager/extensions.lua +++ b/multi/integration/lovrManager/extensions.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/lovrManager/init.lua b/multi/integration/lovrManager/init.lua index 523382a..a20e607 100644 --- a/multi/integration/lovrManager/init.lua +++ b/multi/integration/lovrManager/init.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/lovrManager/threads.lua b/multi/integration/lovrManager/threads.lua index b373136..49d5bb8 100644 --- a/multi/integration/lovrManager/threads.lua +++ b/multi/integration/lovrManager/threads.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/luvitManager.lua b/multi/integration/luvitManager.lua index 73ee666..48f6f80 100644 --- a/multi/integration/luvitManager.lua +++ b/multi/integration/luvitManager.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/channel.lua b/multi/integration/networkManager/channel.lua index 2fc61b3..3083241 100644 --- a/multi/integration/networkManager/channel.lua +++ b/multi/integration/networkManager/channel.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/childNode.lua b/multi/integration/networkManager/childNode.lua index 24945fa..43837d5 100644 --- a/multi/integration/networkManager/childNode.lua +++ b/multi/integration/networkManager/childNode.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/clientSide.lua b/multi/integration/networkManager/clientSide.lua index b640568..9210840 100644 --- a/multi/integration/networkManager/clientSide.lua +++ b/multi/integration/networkManager/clientSide.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/cmds.lua b/multi/integration/networkManager/cmds.lua index a6097ae..ccb3c2f 100644 --- a/multi/integration/networkManager/cmds.lua +++ b/multi/integration/networkManager/cmds.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/extensions.lua b/multi/integration/networkManager/extensions.lua index 0752381..c4cac79 100644 --- a/multi/integration/networkManager/extensions.lua +++ b/multi/integration/networkManager/extensions.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/init.lua b/multi/integration/networkManager/init.lua index 98f9831..23fcd7e 100644 --- a/multi/integration/networkManager/init.lua +++ b/multi/integration/networkManager/init.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/masterNode.lua b/multi/integration/networkManager/masterNode.lua index 2ea9b1e..df3eab7 100644 --- a/multi/integration/networkManager/masterNode.lua +++ b/multi/integration/networkManager/masterNode.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/node.lua b/multi/integration/networkManager/node.lua index 4723725..8151b57 100644 --- a/multi/integration/networkManager/node.lua +++ b/multi/integration/networkManager/node.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/nodeManager.lua b/multi/integration/networkManager/nodeManager.lua index 73cf06a..840bc60 100644 --- a/multi/integration/networkManager/nodeManager.lua +++ b/multi/integration/networkManager/nodeManager.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/serverSide.lua b/multi/integration/networkManager/serverSide.lua index 2c2291f..4d8b771 100644 --- a/multi/integration/networkManager/serverSide.lua +++ b/multi/integration/networkManager/serverSide.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/threads.lua b/multi/integration/networkManager/threads.lua index 0752381..c4cac79 100644 --- a/multi/integration/networkManager/threads.lua +++ b/multi/integration/networkManager/threads.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/networkManager/utils.lua b/multi/integration/networkManager/utils.lua index 0aeac3c..9ebdb1b 100644 --- a/multi/integration/networkManager/utils.lua +++ b/multi/integration/networkManager/utils.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/pesudoManager/extensions.lua b/multi/integration/pesudoManager/extensions.lua index deae13d..9942d1d 100644 --- a/multi/integration/pesudoManager/extensions.lua +++ b/multi/integration/pesudoManager/extensions.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/multi/integration/pesudoManager/threads.lua b/multi/integration/pesudoManager/threads.lua index febac47..3f97e46 100644 --- a/multi/integration/pesudoManager/threads.lua +++ b/multi/integration/pesudoManager/threads.lua @@ -1,7 +1,7 @@ --[[ MIT License -Copyright (c) 2020 Ryan Ward +Copyright (c) 2022 Ryan Ward Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test3.lua b/test3.lua new file mode 100644 index 0000000..3afc3ad --- /dev/null +++ b/test3.lua @@ -0,0 +1,17 @@ +lanes = require("lanes").configure({allocator="protected",verbose_errors=""}) +local multi,thread = require("multi"):init() +function sleep(n) + if n > 0 then os.execute("ping -n " .. tonumber(n+1) .. " localhost > NUL") end +end + +lanes.gen("*",function() + print("Hello!") +end)() + +multi:newThread("Test thread",function() + while true do + thread.sleep(1) + print("...") + end +end) +multi:mainloop() \ No newline at end of file