Ejemplo n.º 1
0
        private void UpdateThreadName(Request <Bitmap> data)
        {
            string name = data.Name;

            StringBuilder builder = s_NameBuilder.Value;

            builder.EnsureCapacity(Utils.ThreadPrefix.Length + name.Length);
            builder.Insert(Utils.ThreadPrefix.Length, name);

            Thread.CurrentThread().Name = builder.ToString();
        }
Ejemplo n.º 2
0
        public void Run()
        {
            try
            {
                UpdateThreadName(m_Data);

                Result = Hunt();

                if (Result == null)
                {
                    m_Dispatcher.DispatchFailed(this);
                }
                else
                {
                    m_Dispatcher.DispatchComplete(this);
                }
            }
            catch (ResponseException ex)
            {
                Exception = ex;
                m_Dispatcher.DispatchFailed(this);
            }
            catch (IOException ex)
            {
                Exception = ex;
                m_Dispatcher.DispatchRetry(this);
            }
            catch (Exception ex)
            {
                Exception = ex;
                m_Dispatcher.DispatchFailed(this);
            }
            finally
            {
                Thread.CurrentThread().Name = Utils.ThreadIdleName;
            }
        }