diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Util.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index b39dc5f..c9930fb 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -2320,6 +2320,29 @@ namespace OpenSim.Framework | |||
2320 | #endregion FireAndForget Threading Pattern | 2320 | #endregion FireAndForget Threading Pattern |
2321 | 2321 | ||
2322 | /// <summary> | 2322 | /// <summary> |
2323 | /// Run the callback on a different thread, outside the thread pool. This is used for tasks | ||
2324 | /// that may take a long time. | ||
2325 | /// </summary> | ||
2326 | public static void RunThreadNoTimeout(WaitCallback callback, string name, object obj) | ||
2327 | { | ||
2328 | Thread t = new Thread(delegate() | ||
2329 | { | ||
2330 | try | ||
2331 | { | ||
2332 | Culture.SetCurrentCulture(); | ||
2333 | callback(obj); | ||
2334 | } | ||
2335 | catch (Exception e) | ||
2336 | { | ||
2337 | m_log.Error("Exception in thread " + name, e); | ||
2338 | } | ||
2339 | }); | ||
2340 | |||
2341 | t.Name = name; | ||
2342 | t.Start(); | ||
2343 | } | ||
2344 | |||
2345 | /// <summary> | ||
2323 | /// Environment.TickCount is an int but it counts all 32 bits so it goes positive | 2346 | /// Environment.TickCount is an int but it counts all 32 bits so it goes positive |
2324 | /// and negative every 24.9 days. This trims down TickCount so it doesn't wrap | 2347 | /// and negative every 24.9 days. This trims down TickCount so it doesn't wrap |
2325 | /// for the callers. | 2348 | /// for the callers. |