Fixing connection * issue

This commit is contained in:
2023-01-04 10:28:02 -05:00
parent 71ab702a75
commit dc9cee5a3e
2 changed files with 47 additions and 1 deletions
+8 -1
View File
@@ -35,7 +35,7 @@ if not _G["$multi"] then
_G["$multi"] = {multi=multi,thread=thread}
end
multi.Version = "15.3.0"
multi.Version = "15.3.1"
multi.Name = "root"
multi.NIL = {Type="NIL"}
local NIL = multi.NIL
@@ -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