[All] Change threading to be global

This commit is contained in:
Matt Nadareski
2017-07-13 17:03:38 -07:00
parent b7b6247ef0
commit 181716fb41
12 changed files with 50 additions and 48 deletions

View File

@@ -52,7 +52,7 @@ namespace SabreTools.Library.Dats
// First do the initial sort of all of the roms
List<string> keys = Keys.ToList();
Parallel.ForEach(keys, Globals.ParallelOptions, key =>
Parallel.ForEach(keys, key =>
{
List<DatItem> roms = this[key];
@@ -143,7 +143,7 @@ namespace SabreTools.Library.Dats
// Now go through and sort all of the individual lists
keys = sortable.Keys.ToList();
Parallel.ForEach(keys, Globals.ParallelOptions, key =>
Parallel.ForEach(keys, key =>
{
// Get the possibly unsorted list
List<DatItem> sortedlist = sortable[key];
@@ -183,7 +183,7 @@ namespace SabreTools.Library.Dats
{
// Loop over every key in the dictionary
List<string> keys = Keys.ToList();
Parallel.ForEach(keys, Globals.ParallelOptions, key =>
Parallel.ForEach(keys, key =>
{
// For every item in the current key
List<DatItem> items = this[key];
@@ -235,7 +235,7 @@ namespace SabreTools.Library.Dats
// First we want to get a mapping for all games to description
ConcurrentDictionary<string, string> mapping = new ConcurrentDictionary<string, string>();
List<string> keys = Keys.ToList();
Parallel.ForEach(keys, Globals.ParallelOptions, key =>
Parallel.ForEach(keys, key =>
{
List<DatItem> items = this[key];
foreach (DatItem item in items)
@@ -250,7 +250,7 @@ namespace SabreTools.Library.Dats
// Now we loop through every item and update accordingly
keys = Keys.ToList();
Parallel.ForEach(keys, Globals.ParallelOptions, key =>
Parallel.ForEach(keys, key =>
{
List<DatItem> items = this[key];
List<DatItem> newItems = new List<DatItem>();
@@ -305,7 +305,7 @@ namespace SabreTools.Library.Dats
// Now process all of the roms
List<string> keys = Keys.ToList();
Parallel.ForEach(keys, Globals.ParallelOptions, key =>
Parallel.ForEach(keys, key =>
{
List<DatItem> items = this[key];
for (int j = 0; j < items.Count; j++)