Example #1
0
 public override void Disconnect()
 {
     Console.WriteLine("Disconnecting...");
     InnerThread.Abort();
     ObjSocket.Shutdown(SocketShutdown.Both);
     ObjSocket.Close();
 }
Example #2
0
 public override void StopWork()
 {
     ShouldStop = true;
     if (IsWaiting)
     {
         InnerThread.Abort();
     }
 }
Example #3
0
 public override void StartWork()
 {
     if (InnerThread.ThreadState != ThreadState.Running)
     {
         IsWaiting = true;
         InnerThread.Start();
     }
 }
Example #4
0
        protected override void Start()
        {
            var currState = ExecutionState;

            if (currState > NotStartedState)
            {
                ThrowHelper.ThrowInvalidOperationException_ExecutionState(currState);
            }
            InnerThread.Start(this);
        }
        protected internal virtual void Start()
        {
            InnerThread.Start();

            while (!_isStarted)
            {
                try
                {
                    Thread.Sleep(1);
                }
                catch (ThreadInterruptedException)
                {
                    _logger.Info("thread {0} interrupted when starting", InnerThread.ManagedThreadId);
                    InnerThread.Interrupt();
                    break;
                }
            }
        }
Example #6
0
 public void Stop()
 {
     InnerThread.Abort();
 }
Example #7
0
 public void Start()
 {
     InnerThread.Start();
 }
Example #8
0
#pragma warning restore CS1591 // 缺少对公共可见类型或成员的 XML 注释

        private void Set(ThreadArgs arg, InnerThread th)
        {
            arg.Recyle();
            ThreadCache.Set(th);
            Interlocked.Decrement(ref ThreadCount);
        }