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
1 changed files with 7 additions and 2 deletions

View File

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