Beispiel #1
0
        public (BsnesTraceLogImporter.Stats stats, int bytesToProcess) GetStats()
        {
            if (importer == null)
            {
                return(cachedStats, 0);
            }

            var cachedBytesInQueue = 0;

            // this is thread-safe and will make a copy for us.
            cachedStats = importer.CurrentStats;

            cachedBytesInQueue = statsBytesToProcess;

            return(cachedStats, cachedBytesInQueue);
        }
        public (BsnesTraceLogImporter.Stats stats, int bytesToProcess) GetStats()
        {
            if (importer == null)
            {
                return(cachedStats, 0);
            }

            var cachedBytesInQueue = 0;

            try
            {
                importerLock.EnterReadLock();
                cachedStats        = importer.CurrentStats;
                cachedBytesInQueue = bytesToProcess;
            }
            finally
            {
                importerLock.ExitReadLock();
            }

            return(cachedStats, cachedBytesInQueue);
        }