首页 > 其他 > 详细

ExeCuteManager

时间:2014-07-21 00:09:33      阅读:399      评论:0      收藏:0      [点我收藏+]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using WindowsFormsApplication3.Jobs;
using WindowsFormsApplication3.DataStorge;
using WindowsFormsApplication3.Enums;

namespace WindowsFormsApplication3.Jobs.Operation_System
{
    public class ExeCuteManager:BaseJob
    {

        public ExeCuteManager(CheckoutContext checkoutContext, CheckoutStep checkoutStep) : base(checkoutContext, checkoutStep) { }


        public override void Execute(object _stateInfo)
        {
            int IntNumber = (int)_stateInfo;
            //获得当前线程的哈希码(标识线程在线程池中的唯一)
            int ThisThreadNumber = Thread.CurrentThread.GetHashCode();
            //指示当前线程是否属于托管线程池
            bool isThreadPool = Thread.CurrentThread.IsThreadPoolThread;
            string strTip = string.Format("请求 {0} 开始,线程哈希码为{1},是否为线程池线程:{2},...", IntNumber, ThisThreadNumber, isThreadPool.ToString());
            ReportStateChange(strTip, IntNumber, false);

            Thread.Sleep(4000);
            strTip = string.Format("请求 {0} 执行结束!", IntNumber);
            ReportStateChange(strTip, IntNumber, true);

        }
    }
    
}

ExeCuteManager,布布扣,bubuko.com

ExeCuteManager

原文:http://www.cnblogs.com/rosizel/p/3857313.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!