From 3e795ede057b1a7712c3dbe74596c687d013f82e Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Wed, 31 Jul 2019 13:10:01 -0400 Subject: [PATCH] love and lanes act more like twins --- changes.md | 3 ++- multi/integration/loveManager.lua | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/changes.md b/changes.md index cddb8a8..ea3480b 100644 --- a/changes.md +++ b/changes.md @@ -1,6 +1,6 @@ # Changes [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: - 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 - 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. +- 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: - 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 diff --git a/multi/integration/loveManager.lua b/multi/integration/loveManager.lua index 02f2f9e..01f6aee 100644 --- a/multi/integration/loveManager.lua +++ b/multi/integration/loveManager.lua @@ -311,11 +311,15 @@ function multi:newSystemThread(name,func,...) -- the main method local c={} c.name=name c.Name = name + c.Type="sthread" c.ID=c.name.."" c.Id=count + c.creationTime = os.clock() count = count + 1 - livingThreads[count] = {true,name} 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,...) function c:kill() multi.integration.GLOBAL["__DIEPLZ"..self.ID.."__"]="__DIEPLZ"..self.ID.."__" @@ -324,6 +328,7 @@ function multi:newSystemThread(name,func,...) -- the main method end function love.threaderror( 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) end local THREAD={}