1
0
mirror of https://github.com/LDDestroier/CC/ synced 2025-07-20 10:52:55 +00:00

Added 'useSleepToYield'

This commit is contained in:
LDDestroier 2019-05-09 01:56:23 -04:00 committed by GitHub
parent ff9afd4ac8
commit 498891c101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ local tArg = {...}
disknet.mainPath = tArg[1] or "disk/DISKNET" disknet.mainPath = tArg[1] or "disk/DISKNET"
local limitChannelsToModem = false local limitChannelsToModem = false
local useSleepToYield = false
local maximumBufferSize = 64 local maximumBufferSize = 64
local openChannels = {} local openChannels = {}
@ -217,10 +218,14 @@ disknet.receive = function(channel, senderFilter)
end end
if output then if output then
break break
else
if useSleepToYield then
sleep(0)
else else
os.queueEvent("") os.queueEvent("")
os.pullEvent("") os.pullEvent("")
end end
end
for i = 1, #fList do for i = 1, #fList do
fList[i].close() fList[i].close()
end end