예제 #1
0
        public static bool QueueExtTask(string taskName, WaitCallback callback, object state, WaitCallback callbackStart, WaitCallback callbackEnd, WaitCallback callbackException)
        {
            ExtTaskInfo ti = new ExtTaskInfo(taskName, state, callback, callbackStart, callbackEnd, callbackException);

            Trace("QueueExtTask : " + taskName);
            return(ThreadPool.QueueUserWorkItem(new WaitCallback(ExtTaskProc), ti));
        }
예제 #2
0
        static void ExtTaskProc(Object stateInfo)
        {
            ExtTaskInfo ti = (ExtTaskInfo)stateInfo;

            Trace("ExtTaskStarted : " + ti.Name);

            try
            {
                ti.DoStartCallback();
            }
            catch (Exception E)
            {
                FreeCL.RTL.Trace.TraceException(E);
                ti.DoExceptionCallback(E);
            }


            try
            {
                ti.DoCallback();
            }
            catch (Exception E)
            {
                FreeCL.RTL.Trace.TraceException(E);
                ti.DoExceptionCallback(E);
            }
            finally
            {
                try
                {
                    ti.DoEndCallback();
                }
                catch (Exception E)
                {
                    FreeCL.RTL.Trace.TraceException(E);
                    ti.DoExceptionCallback(E);
                }
            }
            Trace("TaskStopped : " + ti.Name);
        }
예제 #3
0
 public static bool QueueExtTask(string taskName, WaitCallback callback, object state, WaitCallback callbackStart, WaitCallback callbackEnd, WaitCallback callbackException)
 {
     ExtTaskInfo ti = new ExtTaskInfo(taskName, state, callback, callbackStart, callbackEnd, callbackException);
     Trace("QueueExtTask : " + taskName);
     return ThreadPool.QueueUserWorkItem(new WaitCallback(ExtTaskProc), ti);
 }