better have a lock
parent
57ec0d3884
commit
235dd37b9c
|
@ -6856,13 +6856,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
private int m_bandwidthBurst = 20000;
|
||||
private int m_bytesControl;
|
||||
private double m_lastBandwithTime;
|
||||
private object m_throttleLock = new object();
|
||||
|
||||
public bool CapCanSendAsset(int type, int size)
|
||||
{
|
||||
if(size == 0)
|
||||
return true;
|
||||
|
||||
if(type > 1)
|
||||
lock (m_throttleLock)
|
||||
{
|
||||
if (type > 1)
|
||||
{
|
||||
// not texture or mesh
|
||||
m_bytesControl -= size;
|
||||
|
@ -6871,7 +6874,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
double currenttime = Util.GetTimeStamp();
|
||||
double timeElapsed = currenttime - m_lastBandwithTime;
|
||||
if (timeElapsed > .05)
|
||||
if (timeElapsed > .02)
|
||||
{
|
||||
m_lastBandwithTime = currenttime;
|
||||
int add = (int)(m_bandwidth * timeElapsed);
|
||||
|
@ -6884,6 +6887,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_bytesControl -= size;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue