From 7420f96128020ba158d9712497d3c36796c88087 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Mon, 7 Jul 2008 09:58:01 +0000 Subject: [PATCH] switching to safer locks. --- .hgignore | 11 ++++++----- OpenSim/Framework/Servers/OSHttpRequestQueue.cs | 10 ++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.hgignore b/.hgignore index 223c8ee09a..97064f7e1f 100644 --- a/.hgignore +++ b/.hgignore @@ -1,4 +1,3 @@ -^tailor.state$ ^tailor.state.old$ ^tailor.state.journal$ \.csproj$ @@ -6,12 +5,14 @@ \.mdp$ \.mds$ \.dll\.build$ -/bin/Debug/.+\.dll$ -/bin/Debug/.+\.dll.mdb$ -^bin/.+\.dll$ +^bin/Debug/.+\.dll$ +bin/.+\.dll.mdb$ +bin/addin-db- +bin/.+\.dll$ +bin/.+\.maddin$ +Examples/.+\.dll$ ^bin/.+\.exe ^(OpenSim|Prebuild)/.+\.(exe|exe\.build|exe\.mdb)$ ^OpenSim\.(build|sln)$ ^Prebuild/Prebuild\.(build|sln)$ .+~$ - diff --git a/OpenSim/Framework/Servers/OSHttpRequestQueue.cs b/OpenSim/Framework/Servers/OSHttpRequestQueue.cs index f3dfda472e..f6f1829276 100644 --- a/OpenSim/Framework/Servers/OSHttpRequestQueue.cs +++ b/OpenSim/Framework/Servers/OSHttpRequestQueue.cs @@ -38,12 +38,14 @@ namespace OpenSim.Framework.Servers /// public class OSHttpRequestQueue : Queue { + private object _syncObject = new object(); + new public void Enqueue(OSHttpRequest req) { - lock (this) + lock (_syncObject) { base.Enqueue(req); - Monitor.Pulse(this); + Monitor.Pulse(_syncObject); } } @@ -51,11 +53,11 @@ namespace OpenSim.Framework.Servers { OSHttpRequest req = null; - lock (this) + lock (_syncObject) { while (null == req) { - Monitor.Wait(this); + Monitor.Wait(_syncObject); if (0 != this.Count) req = base.Dequeue(); } }