OpenSim/Framework/Monitoring/WorkManager.cs
/// <summary>
/// Run the callback in a new thread immediately.  If the thread exits with an exception log it but do
/// not propogate it.
/// </summary>
/// <param name="callback">Code for the thread to execute.</param>
/// <param name="obj">Object to pass to the thread.</param>
/// <param name="name">Name of the thread</param>
Run the callback in a new thread immediately.  If the thread exits with an exception log it but do
not propogate it.
Run the callback in a new thread immediately . If the thread exits with an exception log it but do not propogate it .
public static void RunInThread(WaitCallback callback, object obj, string name, bool log = false)
        {
            if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest)           
            {
                Culture.SetCurrentCulture();
                callback(obj);
                return;
            }
            ThreadStart ts = new ThreadStart(delegate()
            {
                try
                {
                    Culture.SetCurrentCulture();
                    callback(obj);
                    Watchdog.RemoveThread(log:false);
                }
                catch (Exception e)
                {
                    m_log.Error(string.Format("[WATCHDOG]: Exception in thread {0}.", name), e);
                }
            });
            StartThread(ts, name, ThreadPriority.Normal, true, false, log:log);
        }
public static void RunInThread ( WaitCallback callback , object obj , string name , bool log = false ) { if ( Util . FireAndForgetMethod == FireAndForgetMethod . RegressionTest ) { Culture . SetCurrentCulture ( ) ; callback ( obj ) ; return ; } ThreadStart ts = new ThreadStart ( delegate ( ) { try { Culture . SetCurrentCulture ( ) ; callback ( obj ) ; Watchdog . RemoveThread ( log : false ) ; } catch ( Exception e ) { m_log . Error ( string . Format ( " " , name ) , e ) ; } } ) ; StartThread ( ts , name , ThreadPriority . Normal , true , false , log : log ) ; }
Run the callback in a new thread immediately.
Run the callback in a new thread immediately .
callback
WaitCallback
Code for the thread to execute.
Code for the thread to execute .
obj
object
Object to pass to the thread.
Object to pass to the thread .
name
string
Name of the thread
Name of the thread
log
bool