diff options
author | Dr Scofield | 2008-07-07 09:58:01 +0000 |
---|---|---|
committer | Dr Scofield | 2008-07-07 09:58:01 +0000 |
commit | 7420f96128020ba158d9712497d3c36796c88087 (patch) | |
tree | caf31c2760e2fb3ff4128308cd41ac1eddf849db /OpenSim/Framework | |
parent | further progress on HttpServer integration: OSHttpRequest can now be (diff) | |
download | opensim-SC_OLD-7420f96128020ba158d9712497d3c36796c88087.zip opensim-SC_OLD-7420f96128020ba158d9712497d3c36796c88087.tar.gz opensim-SC_OLD-7420f96128020ba158d9712497d3c36796c88087.tar.bz2 opensim-SC_OLD-7420f96128020ba158d9712497d3c36796c88087.tar.xz |
switching to safer locks.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Servers/OSHttpRequestQueue.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/OpenSim/Framework/Servers/OSHttpRequestQueue.cs b/OpenSim/Framework/Servers/OSHttpRequestQueue.cs index f3dfda4..f6f1829 100644 --- a/OpenSim/Framework/Servers/OSHttpRequestQueue.cs +++ b/OpenSim/Framework/Servers/OSHttpRequestQueue.cs | |||
@@ -38,12 +38,14 @@ namespace OpenSim.Framework.Servers | |||
38 | /// </summary> | 38 | /// </summary> |
39 | public class OSHttpRequestQueue : Queue<OSHttpRequest> | 39 | public class OSHttpRequestQueue : Queue<OSHttpRequest> |
40 | { | 40 | { |
41 | private object _syncObject = new object(); | ||
42 | |||
41 | new public void Enqueue(OSHttpRequest req) | 43 | new public void Enqueue(OSHttpRequest req) |
42 | { | 44 | { |
43 | lock (this) | 45 | lock (_syncObject) |
44 | { | 46 | { |
45 | base.Enqueue(req); | 47 | base.Enqueue(req); |
46 | Monitor.Pulse(this); | 48 | Monitor.Pulse(_syncObject); |
47 | } | 49 | } |
48 | } | 50 | } |
49 | 51 | ||
@@ -51,11 +53,11 @@ namespace OpenSim.Framework.Servers | |||
51 | { | 53 | { |
52 | OSHttpRequest req = null; | 54 | OSHttpRequest req = null; |
53 | 55 | ||
54 | lock (this) | 56 | lock (_syncObject) |
55 | { | 57 | { |
56 | while (null == req) | 58 | while (null == req) |
57 | { | 59 | { |
58 | Monitor.Wait(this); | 60 | Monitor.Wait(_syncObject); |
59 | if (0 != this.Count) req = base.Dequeue(); | 61 | if (0 != this.Count) req = base.Dequeue(); |
60 | } | 62 | } |
61 | } | 63 | } |