switching to safer locks.

0.6.0-stable
Dr Scofield 2008-07-07 09:58:01 +00:00
parent 7f0bcc5aa1
commit 7420f96128
2 changed files with 12 additions and 9 deletions

View File

@ -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)$
.+~$

View File

@ -38,12 +38,14 @@ namespace OpenSim.Framework.Servers
/// </summary>
public class OSHttpRequestQueue : Queue<OSHttpRequest>
{
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();
}
}