diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/BlockingQueue.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/Serialization/External/LandDataSerializer.cs | 24 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 18 |
4 files changed, 26 insertions, 24 deletions
diff --git a/OpenSim/Framework/BlockingQueue.cs b/OpenSim/Framework/BlockingQueue.cs index 857930a..3658161 100644 --- a/OpenSim/Framework/BlockingQueue.cs +++ b/OpenSim/Framework/BlockingQueue.cs | |||
@@ -67,8 +67,8 @@ namespace OpenSim.Framework | |||
67 | return m_pqueue.Dequeue(); | 67 | return m_pqueue.Dequeue(); |
68 | 68 | ||
69 | if (m_queue.Count > 0) | 69 | if (m_queue.Count > 0) |
70 | return m_queue.Dequeue(); | 70 | return m_queue.Dequeue(); |
71 | return default(T); | 71 | return default(T); |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
@@ -121,7 +121,7 @@ namespace OpenSim.Framework | |||
121 | { | 121 | { |
122 | m_pqueue.Clear(); | 122 | m_pqueue.Clear(); |
123 | m_queue.Clear(); | 123 | m_queue.Clear(); |
124 | Monitor.Pulse(m_queueSync); | 124 | Monitor.Pulse(m_queueSync); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | } | 127 | } |
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index a3bc5d1..ff0afc8 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Framework.Serialization.External | |||
41 | public class LandDataSerializer | 41 | public class LandDataSerializer |
42 | { | 42 | { |
43 | protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); | 43 | protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Reify/deserialize landData | 46 | /// Reify/deserialize landData |
47 | /// </summary> | 47 | /// </summary> |
@@ -52,7 +52,7 @@ namespace OpenSim.Framework.Serialization.External | |||
52 | { | 52 | { |
53 | return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length)); | 53 | return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length)); |
54 | } | 54 | } |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// Reify/deserialize landData | 57 | /// Reify/deserialize landData |
58 | /// </summary> | 58 | /// </summary> |
@@ -62,10 +62,10 @@ namespace OpenSim.Framework.Serialization.External | |||
62 | public static LandData Deserialize(string serializedLandData) | 62 | public static LandData Deserialize(string serializedLandData) |
63 | { | 63 | { |
64 | LandData landData = new LandData(); | 64 | LandData landData = new LandData(); |
65 | 65 | ||
66 | StringReader sr = new StringReader(serializedLandData); | 66 | StringReader sr = new StringReader(serializedLandData); |
67 | XmlTextReader xtr = new XmlTextReader(sr); | 67 | XmlTextReader xtr = new XmlTextReader(sr); |
68 | 68 | ||
69 | xtr.ReadStartElement("LandData"); | 69 | xtr.ReadStartElement("LandData"); |
70 | 70 | ||
71 | landData.Area = Convert.ToInt32( xtr.ReadElementString("Area")); | 71 | landData.Area = Convert.ToInt32( xtr.ReadElementString("Area")); |
@@ -106,7 +106,7 @@ namespace OpenSim.Framework.Serialization.External | |||
106 | pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time")); | 106 | pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time")); |
107 | pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); | 107 | pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); |
108 | xtr.ReadEndElement(); | 108 | xtr.ReadEndElement(); |
109 | 109 | ||
110 | landData.ParcelAccessList.Add(pae); | 110 | landData.ParcelAccessList.Add(pae); |
111 | } | 111 | } |
112 | } | 112 | } |
@@ -122,13 +122,13 @@ namespace OpenSim.Framework.Serialization.External | |||
122 | landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); | 122 | landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); |
123 | 123 | ||
124 | xtr.ReadEndElement(); | 124 | xtr.ReadEndElement(); |
125 | 125 | ||
126 | xtr.Close(); | 126 | xtr.Close(); |
127 | sr.Close(); | 127 | sr.Close(); |
128 | 128 | ||
129 | return landData; | 129 | return landData; |
130 | } | 130 | } |
131 | 131 | ||
132 | public static string Serialize(LandData landData) | 132 | public static string Serialize(LandData landData) |
133 | { | 133 | { |
134 | StringWriter sw = new StringWriter(); | 134 | StringWriter sw = new StringWriter(); |
@@ -137,8 +137,8 @@ namespace OpenSim.Framework.Serialization.External | |||
137 | 137 | ||
138 | xtw.WriteStartDocument(); | 138 | xtw.WriteStartDocument(); |
139 | xtw.WriteStartElement("LandData"); | 139 | xtw.WriteStartElement("LandData"); |
140 | 140 | ||
141 | xtw.WriteElementString("Area", Convert.ToString(landData.Area)); | 141 | xtw.WriteElementString("Area", Convert.ToString(landData.Area)); |
142 | xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID)); | 142 | xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID)); |
143 | xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString()); | 143 | xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString()); |
144 | xtw.WriteElementString("Category", Convert.ToString((sbyte)landData.Category)); | 144 | xtw.WriteElementString("Category", Convert.ToString((sbyte)landData.Category)); |
@@ -170,7 +170,7 @@ namespace OpenSim.Framework.Serialization.External | |||
170 | xtw.WriteEndElement(); | 170 | xtw.WriteEndElement(); |
171 | } | 171 | } |
172 | xtw.WriteEndElement(); | 172 | xtw.WriteEndElement(); |
173 | 173 | ||
174 | xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours)); | 174 | xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours)); |
175 | xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice)); | 175 | xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice)); |
176 | xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice)); | 176 | xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice)); |
@@ -184,7 +184,7 @@ namespace OpenSim.Framework.Serialization.External | |||
184 | 184 | ||
185 | xtw.Close(); | 185 | xtw.Close(); |
186 | sw.Close(); | 186 | sw.Close(); |
187 | 187 | ||
188 | return sw.ToString(); | 188 | return sw.ToString(); |
189 | } | 189 | } |
190 | } | 190 | } |
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 845a9fe..0d93ff7 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -246,7 +246,7 @@ namespace OpenSim.Framework.Servers | |||
246 | foreach (ProcessThread t in threads) | 246 | foreach (ProcessThread t in threads) |
247 | { | 247 | { |
248 | sb.Append("ID: " + t.Id + ", TotalProcessorTime: " + t.TotalProcessorTime + ", TimeRunning: " + | 248 | sb.Append("ID: " + t.Id + ", TotalProcessorTime: " + t.TotalProcessorTime + ", TimeRunning: " + |
249 | (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState ); | 249 | (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState); |
250 | if (t.ThreadState == System.Diagnostics.ThreadState.Wait) | 250 | if (t.ThreadState == System.Diagnostics.ThreadState.Wait) |
251 | sb.Append(", Reason: " + t.WaitReason + Environment.NewLine); | 251 | sb.Append(", Reason: " + t.WaitReason + Environment.NewLine); |
252 | else | 252 | else |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 3203fc1..d5ae3b7 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1273,7 +1273,7 @@ namespace OpenSim.Framework | |||
1273 | /// <summary> | 1273 | /// <summary> |
1274 | /// Created to work around a limitation in Mono with nested delegates | 1274 | /// Created to work around a limitation in Mono with nested delegates |
1275 | /// </summary> | 1275 | /// </summary> |
1276 | private class FireAndForgetWrapper | 1276 | /*private class FireAndForgetWrapper |
1277 | { | 1277 | { |
1278 | public void FireAndForget(System.Threading.WaitCallback callback) | 1278 | public void FireAndForget(System.Threading.WaitCallback callback) |
1279 | { | 1279 | { |
@@ -1284,21 +1284,23 @@ namespace OpenSim.Framework | |||
1284 | { | 1284 | { |
1285 | callback.BeginInvoke(obj, EndFireAndForget, callback); | 1285 | callback.BeginInvoke(obj, EndFireAndForget, callback); |
1286 | } | 1286 | } |
1287 | } | 1287 | }*/ |
1288 | 1288 | ||
1289 | public static void FireAndForget(System.Threading.WaitCallback callback) | 1289 | public static void FireAndForget(System.Threading.WaitCallback callback) |
1290 | { | 1290 | { |
1291 | FireAndForgetWrapper wrapper = Singleton.GetInstance<FireAndForgetWrapper>(); | 1291 | //FireAndForgetWrapper wrapper = Singleton.GetInstance<FireAndForgetWrapper>(); |
1292 | wrapper.FireAndForget(callback); | 1292 | //wrapper.FireAndForget(callback); |
1293 | System.Threading.ThreadPool.UnsafeQueueUserWorkItem(callback, null); | ||
1293 | } | 1294 | } |
1294 | 1295 | ||
1295 | public static void FireAndForget(System.Threading.WaitCallback callback, object obj) | 1296 | public static void FireAndForget(System.Threading.WaitCallback callback, object obj) |
1296 | { | 1297 | { |
1297 | FireAndForgetWrapper wrapper = Singleton.GetInstance<FireAndForgetWrapper>(); | 1298 | //FireAndForgetWrapper wrapper = Singleton.GetInstance<FireAndForgetWrapper>(); |
1298 | wrapper.FireAndForget(callback, obj); | 1299 | //wrapper.FireAndForget(callback, obj); |
1300 | System.Threading.ThreadPool.UnsafeQueueUserWorkItem(callback, obj); | ||
1299 | } | 1301 | } |
1300 | 1302 | ||
1301 | private static void EndFireAndForget(IAsyncResult ar) | 1303 | /*private static void EndFireAndForget(IAsyncResult ar) |
1302 | { | 1304 | { |
1303 | System.Threading.WaitCallback callback = (System.Threading.WaitCallback)ar.AsyncState; | 1305 | System.Threading.WaitCallback callback = (System.Threading.WaitCallback)ar.AsyncState; |
1304 | 1306 | ||
@@ -1306,7 +1308,7 @@ namespace OpenSim.Framework | |||
1306 | catch (Exception ex) { m_log.Error("[UTIL]: Asynchronous method threw an exception: " + ex.Message, ex); } | 1308 | catch (Exception ex) { m_log.Error("[UTIL]: Asynchronous method threw an exception: " + ex.Message, ex); } |
1307 | 1309 | ||
1308 | ar.AsyncWaitHandle.Close(); | 1310 | ar.AsyncWaitHandle.Close(); |
1309 | } | 1311 | }*/ |
1310 | 1312 | ||
1311 | #endregion FireAndForget Threading Pattern | 1313 | #endregion FireAndForget Threading Pattern |
1312 | } | 1314 | } |