diff --git a/README.md b/README.md index 3de8132..f467bd2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Multi Version: 15.3.0 A world of Connections +# Multi Version: 15.3.1 A world of Connections **Key Changes** - SystemThreadedConnections - Restructured the directory structure of the repo (Allows for keeping multi as a submodule and being able to require it as is) diff --git a/docs/changes.md b/docs/changes.md index 0975926..2c3b00d 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -1,10 +1,34 @@ # Changelog Table of contents --- +[Update 15.3.1 - Bug fix](#update-1531---bug-fix)
[Update 15.3.0 - A world of connections](#update-1530---a-world-of-connections)
[Update 15.2.1 - Bug fix](#update-1521---bug-fix)
[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.3.1 - Bug fix +Fixed +--- +- Issue where multiplying connections triggered events improperly +```lua +local multi, thread = require("multi"):init() +conn1 = multi:newConnection() +conn2 = multi:newConnection(); -- To remove function ambiguity + +(conn1 * conn2)(function() print("Triggered!") end) + +conn1:Fire() +conn2:Fire() + +-- Looks like this is triggering a response. It shouldn't. We need to account for this +conn1:Fire() +conn1:Fire() +-- Triggering conn1 twice counted as a valid way to trigger the phantom connection (conn1 * conn2) + +-- Now in 15.3.1, this works properly and the above doesn't do anything. Internally connections are locked until the conditions are met. +conn2:Fire() +``` + # Update 15.3.0 - A world of Connections Full Update Showcase diff --git a/init.lua b/init.lua index dc4f8ca..8169c61 100644 --- a/init.lua +++ b/init.lua @@ -168,17 +168,23 @@ function multi:newConnection(protect,func,kill) c1(function(...) cn.__count[1] = cn.__count[1] + 1 + c1:Lock() if cn.__count[1] == cn.__hasInstances[1] then cn:Fire(...) cn.__count[1] = 0 + c1:Unlock() + c2:Unlock() end end) c2(function(...) cn.__count[1] = cn.__count[1] + 1 + c2:Lock() if cn.__count[1] == cn.__hasInstances[1] then cn:Fire(...) cn.__count[1] = 0 + c1:Unlock() + c2:Unlock() end end) return cn @@ -259,6 +265,7 @@ function multi:newConnection(protect,func,kill) function c:fastMode() if find_optimization then return self end function self:Fire(...) + if lock then return end for i=1,#fast do fast[i](...) end diff --git a/rockspecs/multi-15.3-1.rockspec b/rockspecs/multi-15.3-1.rockspec new file mode 100644 index 0000000..d811a82 --- /dev/null +++ b/rockspecs/multi-15.3-1.rockspec @@ -0,0 +1,39 @@ +package = "multi" +version = "15.3-1" +source = { + url = "git://github.com/rayaman/multi.git", + tag = "15.3.1", +} +description = { + summary = "Lua Multi tasking library", + detailed = [[ + This library contains many methods for multi tasking. Features non coroutine based multi-tasking, coroutine based multi-tasking, and system threading (Requires use of an integration). + Check github for documentation. + ]], + homepage = "https://github.com/rayaman/multi", + license = "MIT" +} +dependencies = { + "lua >= 5.1" +} +build = { + type = "builtin", + modules = { + ["multi"] = "init.lua", + ["multi.integration.lanesManager"] = "integration/lanesManager/init.lua", + ["multi.integration.lanesManager.extensions"] = "integration/lanesManager/extensions.lua", + ["multi.integration.lanesManager.threads"] = "integration/lanesManager/threads.lua", + ["multi.integration.loveManager"] = "integration/loveManager/init.lua", + ["multi.integration.loveManager.extensions"] = "integration/loveManager/extensions.lua", + ["multi.integration.loveManager.threads"] = "integration/loveManager/threads.lua", + --["multi.integration.lovrManager"] = "integration/lovrManager/init.lua", + --["multi.integration.lovrManager.extensions"] = "integration/lovrManager/extensions.lua", + --["multi.integration.lovrManager.threads"] = "integration/lovrManager/threads.lua", + ["multi.integration.pesudoManager"] = "integration/pesudoManager/init.lua", + ["multi.integration.pesudoManager.extensions"] = "integration/pesudoManager/extensions.lua", + ["multi.integration.pesudoManager.threads"] = "integration/pesudoManager/threads.lua", + ["multi.integration.luvitManager"] = "integration/luvitManager.lua", + ["multi.integration.threading"] = "integration/threading.lua", + --["multi.integration.networkManager"] = "integration/networkManager.lua", + } +} \ No newline at end of file