dont request a workjob if we can see there is nothing to do

LSLKeyTest
UbitUmarov 2016-08-24 06:20:04 +01:00
parent 8f509af1f4
commit 99c3b61bd9
1 changed files with 18 additions and 12 deletions

View File

@ -124,20 +124,26 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
double now = Util.GetTimeStampMS();
if(now - lastTimeTick > 1750.0)
{
inTimeTick = true;
//don't overload busy heartbeat
WorkManager.RunInThread(
delegate
{
transfersTimeTick(now);
expireFiles(now);
if(Transfers.Count == 0 && NewFiles.Count == 0)
lastTimeTick = now;
inTimeTick = false;
},
null,
"XferTimeTick");
else
{
inTimeTick = true;
//don't overload busy heartbeat
WorkManager.RunInThread(
delegate
{
transfersTimeTick(now);
expireFiles(now);
lastTimeTick = now;
inTimeTick = false;
},
null,
"XferTimeTick");
}
}
}
Monitor.Exit(timeTickLock);