love and lanes act more like twins

This commit is contained in:
Ryan Ward 2019-07-31 13:10:01 -04:00
parent 0476164cf6
commit 3e795ede05
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# Changes # Changes
[TOC] [TOC]
Update 13.1.0 Bug fixes and some new features (Will upgrade version to 14.0.0 if significant changes are made) Update 13.1.0 Bug fixes and some new features
------------- -------------
Added: Added:
- Connections:Lock() -- Prevents a connection object form being fired - Connections:Lock() -- Prevents a connection object form being fired
@ -30,6 +30,7 @@ Fixed:
- Minor bug with multi:newThread() in how names and functions were managed - Minor bug with multi:newThread() in how names and functions were managed
- Major bug with the system thread handler. Saw healthy threads as dead ones - Major bug with the system thread handler. Saw healthy threads as dead ones
- Major bug the thread scheduler was seen creating a massive amount of 'event' causing memory leaks and hard crashes! This has been fixed by changing how the scheduler opperates. - Major bug the thread scheduler was seen creating a massive amount of 'event' causing memory leaks and hard crashes! This has been fixed by changing how the scheduler opperates.
- newSystemThread()'s returned object now matches both the lanes and love2d in terms of methods that are usable. Error handling of System threads now behave the same across both love and lanes implementations.
Changed: Changed:
- getTasksDetails("t"), the table varaiant, formats threads, and system threads in the same way that tasks are formatted. Please see below for the format of the task details - getTasksDetails("t"), the table varaiant, formats threads, and system threads in the same way that tasks are formatted. Please see below for the format of the task details

View File

@ -311,11 +311,15 @@ function multi:newSystemThread(name,func,...) -- the main method
local c={} local c={}
c.name=name c.name=name
c.Name = name c.Name = name
c.Type="sthread"
c.ID=c.name.."<ID|"..randomString(8)..">" c.ID=c.name.."<ID|"..randomString(8)..">"
c.Id=count c.Id=count
c.creationTime = os.clock()
count = count + 1 count = count + 1
livingThreads[count] = {true,name}
c.thread=love.thread.newThread(multi.integration.love2d.ThreadBase:gsub("INSERT_USER_CODE",dump(func))) c.thread=love.thread.newThread(multi.integration.love2d.ThreadBase:gsub("INSERT_USER_CODE",dump(func)))
livingThreads[count] = {true,name}
livingThreads[thread] = c
c.OnError = multi:newConnection()
c.thread:start(c.ID,c.name,THREAD_ID,...) c.thread:start(c.ID,c.name,THREAD_ID,...)
function c:kill() function c:kill()
multi.integration.GLOBAL["__DIEPLZ"..self.ID.."__"]="__DIEPLZ"..self.ID.."__" multi.integration.GLOBAL["__DIEPLZ"..self.ID.."__"]="__DIEPLZ"..self.ID.."__"
@ -324,6 +328,7 @@ function multi:newSystemThread(name,func,...) -- the main method
end end
function love.threaderror( thread, errorstr ) function love.threaderror( thread, errorstr )
multi.OnError:Fire(thread,errorstr) multi.OnError:Fire(thread,errorstr)
livingThreads[thread].OnError:Fire(threads[i],err,"Error in systemThread: '"..livingThreads[thread].name.."' <"..errorstr..">")
multi.print("Error in systemThread: "..tostring(thread)..": "..errorstr) multi.print("Error in systemThread: "..tostring(thread)..": "..errorstr)
end end
local THREAD={} local THREAD={}