blob: 3b7c18256eac897d18df649b23bfd5bacd7e3083 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Region.Environment.Scenes;
using libsecondlife;
namespace OpenSim.Region.Environment.Types
{
public class UpdateQueue
{
private Queue<SceneObjectPart> m_queue;
private List<LLUUID> m_ids;
public int Count
{
get { return m_queue.Count; }
}
public UpdateQueue()
{
m_queue = new Queue<SceneObjectPart>();
m_ids = new List<LLUUID>();
}
public void Enqueue(SceneObjectPart part)
{
lock (m_ids)
{
if (!m_ids.Contains(part.UUID))
{
m_ids.Add(part.UUID);
m_queue.Enqueue(part);
}
}
}
public SceneObjectPart Dequeue()
{
SceneObjectPart part = null;
if (m_queue.Count > 0)
{
part = m_queue.Dequeue();
lock (m_ids)
{
m_ids.Remove(part.UUID);
}
}
return part;
}
}
}
|