diff options
Diffstat (limited to 'OpenSim/Framework/Parallel.cs')
-rw-r--r-- | OpenSim/Framework/Parallel.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/OpenSim/Framework/Parallel.cs b/OpenSim/Framework/Parallel.cs index 6efdad0..70eecdc 100644 --- a/OpenSim/Framework/Parallel.cs +++ b/OpenSim/Framework/Parallel.cs | |||
@@ -36,7 +36,7 @@ namespace OpenSim.Framework | |||
36 | /// </summary> | 36 | /// </summary> |
37 | public static class Parallel | 37 | public static class Parallel |
38 | { | 38 | { |
39 | private static readonly int processorCount = System.Environment.ProcessorCount; | 39 | public static readonly int ProcessorCount = System.Environment.ProcessorCount; |
40 | 40 | ||
41 | /// <summary> | 41 | /// <summary> |
42 | /// Executes a for loop in which iterations may run in parallel | 42 | /// Executes a for loop in which iterations may run in parallel |
@@ -46,7 +46,7 @@ namespace OpenSim.Framework | |||
46 | /// <param name="body">Method body to run for each iteration of the loop</param> | 46 | /// <param name="body">Method body to run for each iteration of the loop</param> |
47 | public static void For(int fromInclusive, int toExclusive, Action<int> body) | 47 | public static void For(int fromInclusive, int toExclusive, Action<int> body) |
48 | { | 48 | { |
49 | For(processorCount, fromInclusive, toExclusive, body); | 49 | For(ProcessorCount, fromInclusive, toExclusive, body); |
50 | } | 50 | } |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
@@ -66,7 +66,7 @@ namespace OpenSim.Framework | |||
66 | 66 | ||
67 | for (int i = 0; i < threadCount; i++) | 67 | for (int i = 0; i < threadCount; i++) |
68 | { | 68 | { |
69 | ThreadPool.QueueUserWorkItem( | 69 | Util.FireAndForget( |
70 | delegate(object o) | 70 | delegate(object o) |
71 | { | 71 | { |
72 | int threadIndex = (int)o; | 72 | int threadIndex = (int)o; |
@@ -103,7 +103,7 @@ namespace OpenSim.Framework | |||
103 | /// <param name="body">Method body to run for each object in the collection</param> | 103 | /// <param name="body">Method body to run for each object in the collection</param> |
104 | public static void ForEach<T>(IEnumerable<T> enumerable, Action<T> body) | 104 | public static void ForEach<T>(IEnumerable<T> enumerable, Action<T> body) |
105 | { | 105 | { |
106 | ForEach<T>(processorCount, enumerable, body); | 106 | ForEach<T>(ProcessorCount, enumerable, body); |
107 | } | 107 | } |
108 | 108 | ||
109 | /// <summary> | 109 | /// <summary> |
@@ -122,7 +122,7 @@ namespace OpenSim.Framework | |||
122 | 122 | ||
123 | for (int i = 0; i < threadCount; i++) | 123 | for (int i = 0; i < threadCount; i++) |
124 | { | 124 | { |
125 | ThreadPool.QueueUserWorkItem( | 125 | Util.FireAndForget( |
126 | delegate(object o) | 126 | delegate(object o) |
127 | { | 127 | { |
128 | int threadIndex = (int)o; | 128 | int threadIndex = (int)o; |
@@ -161,7 +161,7 @@ namespace OpenSim.Framework | |||
161 | /// <param name="actions">A series of method bodies to execute</param> | 161 | /// <param name="actions">A series of method bodies to execute</param> |
162 | public static void Invoke(params Action[] actions) | 162 | public static void Invoke(params Action[] actions) |
163 | { | 163 | { |
164 | Invoke(processorCount, actions); | 164 | Invoke(ProcessorCount, actions); |
165 | } | 165 | } |
166 | 166 | ||
167 | /// <summary> | 167 | /// <summary> |
@@ -178,7 +178,7 @@ namespace OpenSim.Framework | |||
178 | 178 | ||
179 | for (int i = 0; i < threadCount; i++) | 179 | for (int i = 0; i < threadCount; i++) |
180 | { | 180 | { |
181 | ThreadPool.QueueUserWorkItem( | 181 | Util.FireAndForget( |
182 | delegate(object o) | 182 | delegate(object o) |
183 | { | 183 | { |
184 | int threadIndex = (int)o; | 184 | int threadIndex = (int)o; |