aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/BlockingQueue.cs
diff options
context:
space:
mode:
authorSean Dague2008-04-14 14:37:36 +0000
committerSean Dague2008-04-14 14:37:36 +0000
commita3da86c6d7811f1ad66f9113bff3868a3e42fa31 (patch)
tree93680d02dbe4fdce1bdd2a3719b735ca21383e24 /OpenSim/Framework/BlockingQueue.cs
parent#952 again (diff)
downloadopensim-SC_OLD-a3da86c6d7811f1ad66f9113bff3868a3e42fa31.zip
opensim-SC_OLD-a3da86c6d7811f1ad66f9113bff3868a3e42fa31.tar.gz
opensim-SC_OLD-a3da86c6d7811f1ad66f9113bff3868a3e42fa31.tar.bz2
opensim-SC_OLD-a3da86c6d7811f1ad66f9113bff3868a3e42fa31.tar.xz
Possible fix for the 100% CPU issue. I've not fully
confirmed that this fixes the issue, however functional correctness of BlockingQueue requires that these locks be put into place anyway.
Diffstat (limited to 'OpenSim/Framework/BlockingQueue.cs')
-rw-r--r--OpenSim/Framework/BlockingQueue.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Framework/BlockingQueue.cs b/OpenSim/Framework/BlockingQueue.cs
index 29fda9c..31e756e 100644
--- a/OpenSim/Framework/BlockingQueue.cs
+++ b/OpenSim/Framework/BlockingQueue.cs
@@ -67,12 +67,18 @@ namespace OpenSim.Framework
67 67
68 public int Count() 68 public int Count()
69 { 69 {
70 return m_queue.Count; 70 lock(m_queueSync)
71 {
72 return m_queue.Count;
73 }
71 } 74 }
72 75
73 public T[] GetQueueArray() 76 public T[] GetQueueArray()
74 { 77 {
75 return m_queue.ToArray(); 78 lock (m_queueSync)
79 {
80 return m_queue.ToArray();
81 }
76 } 82 }
77 } 83 }
78} 84}