Ejemplo n.º 1
0
 /// <summary>
 /// 线程池线程
 /// </summary>
 /// <param name="threadPool">线程池</param>
 /// <param name="stackSize">堆栈大小</param>
 /// <param name="task">任务委托</param>
 /// <param name="taskType">任务委托调用类型</param>
 internal thread(threadPool threadPool, int stackSize, object task, callType taskType)
 {
     this.task.Set(task, taskType);
     this.domainUnload.Type    = fastCSharp.domainUnload.unloadType.None;
     this.onErrorType          = errorType.None;
     waitHandle                = new autoWaitHandle(false);
     this.threadPool           = threadPool;
     threadHandle              = new Thread(run, stackSize);
     threadHandle.IsBackground = true;
     threadIndex               = threads.Push(threadHandle);
     threadHandle.Start();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 线程池线程
 /// </summary>
 /// <param name="threadPool">线程池</param>
 /// <param name="stackSize">堆栈大小</param>
 /// <param name="task">任务委托</param>
 /// <param name="domainUnload">应用程序退出处理</param>
 /// <param name="onError">应用程序退出处理</param>
 /// <param name="taskType">任务委托调用类型</param>
 /// <param name="domainUnloadType">应用程序退出处理调用类型</param>
 /// <param name="onErrorType">应用程序退出处理调用类型</param>
 internal thread(threadPool threadPool, int stackSize, object task, object onError, object domainUnload, callType taskType, errorType onErrorType, domainUnload.unloadType domainUnloadType)
 {
     this.task.Set(task, taskType);
     this.domainUnload.Set(domainUnload, domainUnloadType);
     this.onError              = onError;
     this.onErrorType          = onErrorType;
     waitHandle                = new autoWaitHandle(false);
     this.threadPool           = threadPool;
     threadHandle              = new Thread(run, stackSize);
     threadHandle.IsBackground = true;
     threadIndex               = threads.Push(threadHandle);
     threadHandle.Start();
 }