Пример #1
0
        public static void Install()
        {
            // make sure TPL installs its own event source
            Task.Factory.StartNew(() => { }, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default);

            var local = new TPLListener();
            Interlocked.CompareExchange(ref s_listener, local, null);
        }
Пример #2
0
        public static void Install()
        {
            // make sure TPL installs its own event source
            Task.Factory.StartNew(() => { }, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default);

            var local = new TPLListener();

            Interlocked.CompareExchange(ref s_listener, local, null);
        }
Пример #3
0
        public static void Install()
        {
            // make sure TPL installs its own event source
            Task.Factory.StartNew(() => { });

            var local = new TPLListener();

            Interlocked.CompareExchange(ref s_listener, local, null);
        }
Пример #4
0
        public static void Uninstall()
        {
            TPLListener local = null;

            Interlocked.Exchange(ref local, s_listener);

            if (local != null)
            {
                local.Dispose();
            }
        }