Пример #1
0
        /// <summary>
        /// Starts the specified processor on a dedicated thread, and returns the
        /// <see cref="Thread"/> object.
        /// </summary>
        /// <param name="processor"></param>
        /// <returns></returns>
        private static Thread StartProcessorThread(QueueProcessor processor)
        {
            var thread = new Thread(
                delegate()
            {
                try
                {
                    processor.Run();
                }
                catch (Exception e)
                {
                    Platform.Log(LogLevel.Error, e);
                }
            });

            if (!String.IsNullOrEmpty(processor.Name))
            {
                thread.Name = processor.Name;
            }

            thread.Start();
            return(thread);
        }