/// <summary>
        /// Initializes the specified interval ms.
        /// </summary>
        /// <param name="intervalMs">The interval ms.</param>
        /// <param name="exec"></param>
        protected virtual void Initialize(int intervalMs, CallbackBackgroundThread exec)
        {
            m_intervalMs = intervalMs;
            m_exec       = exec;

            if (m_exec == null)
            {
                throw new ArgumentNullException("exec");
            }
            if (intervalMs <= 0)
            {
                throw new ArgumentException("intervalMs");
            }

            m_thread = new Thread(Run);
            m_thread.IsBackground = true;
            m_thread.Name         = typeof(FinalizableBackgroundThread).Name;
            m_thread.Priority     = ThreadPriority.BelowNormal;
            m_thread.Start();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FinalizableBackgroundThread"/> class.
 /// </summary>
 /// <param name="intervalMs">The interval in milliseconds.</param>
 /// <param name="exec">The exec.</param>
 public FinalizableBackgroundThread(int intervalMs, CallbackBackgroundThread exec)
 {
     Initialize(intervalMs, exec);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LoggerBackgroundThread"/> class.
 /// </summary>
 /// <param name="intervalMs">The interval in milliseconds.</param>
 /// <param name="exec">The exec.</param>
 public LoggerBackgroundThread(int intervalMs, CallbackBackgroundThread exec)
     : base(intervalMs, exec)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FinalizableBackgroundThread"/> class.
 /// </summary>
 /// <param name="intervalMs">The interval in milliseconds.</param>
 /// <param name="exec">The exec.</param>
 public FinalizableBackgroundThread(int intervalMs, CallbackBackgroundThread exec)
 {
     Initialize(intervalMs, exec);
 }
        /// <summary>
        /// Initializes the specified interval ms.
        /// </summary>
        /// <param name="intervalMs">The interval ms.</param>
        /// <param name="exec"></param>
        protected virtual void Initialize(int intervalMs, CallbackBackgroundThread exec)
        {
            m_intervalMs = intervalMs;
            m_exec = exec;

            if (m_exec == null)
            {
                throw new ArgumentNullException("exec");
            }
            if (intervalMs <= 0)
            {
                throw new ArgumentException("intervalMs");
            }

            m_thread = new Thread(Run);
            m_thread.IsBackground = true;
            m_thread.Name = this.GetType().Name;
            m_thread.Priority = ThreadPriority.BelowNormal;
            m_thread.Start();
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LoggerBackgroundThread"/> class.
 /// </summary>
 /// <param name="intervalMs">The interval in milliseconds.</param>
 /// <param name="exec">The exec.</param>
 public LoggerBackgroundThread(int intervalMs, CallbackBackgroundThread exec)
     : base(intervalMs, exec)
 {
 }