Beispiel #1
0
        public void Configuration(IAppBuilder app)
        {
            // Any connection or hub wire up and configuration should go here
            app.MapSignalR();

            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            //RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Configure Web API for self-host.
            HttpConfiguration config = new HttpConfiguration();

            //  Enable attribute based routing
            config.MapHttpAttributeRoutes();

            app.UseWebApi(config);

            var properties          = new AppProperties(app.Properties);
            CancellationToken token = properties.OnAppDisposing;

            if (token != CancellationToken.None)
            {
                token.Register(() =>
                {
                    Utilities.ThreadTracker thTrckr = Utilities.ThreadTracker.GetInstance();
                    thTrckr.IsAppStopped            = true;
                });
            }
        }
Beispiel #2
0
 public static ThreadTracker GetInstance()
 {
     lock (_lockObj)
     {
         if (_instance == null)
         {
             lock (_lockObj)
             {
                 _instance = new ThreadTracker();
             }
         }
         return(_instance);
     }
 }