mirror of
https://github.com/rayaman/multi.git
synced 2026-09-05 07:27:35 -04:00
Fixing connection * issue
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user