示例#1
0
        public ThumbnailManager(ISynchronizationContext syncContext)
        {
            int logicalCpuCount = Processor.LogicalCpuCount;
            int num2            = 50;
            int num3            = 320;

            while ((logicalCpuCount > 0) && (num3 > 0))
            {
                num3 = num3 >> 1;
                logicalCpuCount--;
            }
            this.updateLatency             = num2 + num3;
            this.syncContext               = syncContext.CreateRef();
            this.updateLock                = new object();
            this.quitRenderThread          = false;
            this.renderQueue               = new Deque <Tuple <IThumbnailProvider, ValueEventHandler <Tuple <IThumbnailProvider, ISurface <ColorBgra> > >, int> >();
            this.renderingInactive         = new ManualResetEvent(true);
            this.renderThread              = new Thread(new ThreadStart(this.RenderThread));
            this.renderThread.IsBackground = true;
            this.renderThread.Name         = "ThumbnailManager";
            this.renderThread.Start();
        }
示例#2
0
 public static ISynchronizationContext CreateRef(this ISynchronizationContext objectRef) =>
 ((ISynchronizationContext)objectRef.CreateRef(typeof(ISynchronizationContext)));