switching to safer locks.
parent
7f0bcc5aa1
commit
7420f96128
11
.hgignore
11
.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)$
|
||||
.+~$
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue