Пример #1
0
        private static int GetLogBackupFileHandle(string filename)
        {
            int i;

            if (!LogBackupFilenameLookup.TryGetValue(filename, out i))
            {
                i = Interlocked.Increment(ref _logBackupFilenameLookupCounter);
                LogBackupFilenameLookup[filename] = i;
                LogBackupFileHandleLookup[i]      = filename;
            }
            return(i);
        }
Пример #2
0
        private static void RemoveFromLogBackupLookup(string filename)
        {
            //** remove from backup streams list
            var fs = BackupStreams[filename];

            if (fs != null)
            {
                fs.Dispose();
                BackupStreams.Remove(filename);
            }
            //** remove from backup filename lookup list
            int i;

            if (LogBackupFilenameLookup.TryGetValue(filename, out i))
            {
                LogBackupFileHandleLookup.Remove(i);
                LogBackupFilenameLookup.Remove(filename);
            }
        }