Пример #1
0
 internal WorkerThread(int index, ThreadTaskManager manager, Action threadStart)
 {
     this.manager        = manager;
     thread              = new Thread(ThreadExecutionLoop);
     thread.IsBackground = true;
     taskData            = new ConcurrentDeque <TaskEntry>();
     this.threadStart    = threadStart;
     UpdateIndex(index);
     thread.Start();
 }
Пример #2
0
 internal WorkerThread(int index, ThreadTaskManager manager, Action <object> threadStart, object initializationInformation)
 {
     this.manager                   = manager;
     thread                         = new Thread(ThreadExecutionLoop);
     thread.IsBackground            = true;
     taskData                       = new ConcurrentDeque <TaskEntry>();
     this.threadStart               = threadStart;
     this.initializationInformation = initializationInformation;
     UpdateIndex(index);
     //#if WINDOWS
     //                ResourcePool.addThreadID(thread.ManagedThreadId);
     //#endif
     thread.Start();
 }
Пример #3
0
            internal WorkerThread(int index, ThreadTaskManager manager, Action <object> threadStart, object initializationInformation)
            {
                this.manager     = manager;
                taskData         = new ConcurrentDeque <TaskEntry>();
                this.threadStart = threadStart;
                this.initializationInformation = initializationInformation;
                UpdateIndex(index);

#if WINRT
                Windows.System.Threading.ThreadPool.RunAsync(op => ThreadExecutionLoop(),
                                                             Windows.System.Threading.WorkItemPriority.Normal,
                                                             Windows.System.Threading.WorkItemOptions.TimeSliced);
#else
                var thread = new Thread(ThreadExecutionLoop);
                thread.IsBackground = true;
                //#if WINDOWS
                //                ResourcePool.addThreadID(thread.ManagedThreadId);
                //#endif
                thread.Start();
#endif
            }