Merge pull request #276 from OTHGMars/queueExecOrder

Queue exec order
This commit is contained in:
Brian Roberts 2020-08-07 11:18:18 -05:00 committed by GitHub
commit 6153d3c27b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,14 +124,16 @@ function SimSet::registerDatablock(%scopeSet, %datablockFilePath, %isExclusive)
if ((!%locked && !%isExclusive)&&($reportModuleFileConflicts)) if ((!%locked && !%isExclusive)&&($reportModuleFileConflicts))
error("found" SPC %datablockFilePath SPC "duplicate file!"); error("found" SPC %datablockFilePath SPC "duplicate file!");
if (!%locked || (%locked && %isExclusive)) if (!%locked || (%locked && %isExclusive))
{ { // Replacing an existing entry, update in-place
DatablockFilesList.erase(%i); DatablockFilesList.setKey(%fullPath, %i);
DatablockFilesList.setValue(%isExclusive, %i);
%locked = true; //Done, but don't return and bypass trace logging below
} }
break;
} }
} }
//if we're not locked, or we are exclusive, go ahead and add it to the pile //if we're not locked, go ahead and add it to the pile
//(ensures exclusives get re-added after that erasure) if (!%locked)
if (!%locked || %isExclusive)
DatablockFilesList.add(%fullPath,%isExclusive); DatablockFilesList.add(%fullPath,%isExclusive);
if ($traceModuleCalls) if ($traceModuleCalls)
DatablockFilesList.echo(); DatablockFilesList.echo();
@ -222,14 +224,16 @@ function SimSet::queueExec(%scopeSet, %execFilePath, %isExclusive)
if ((!%locked && !%isExclusive)&&($reportModuleFileConflicts)) if ((!%locked && !%isExclusive)&&($reportModuleFileConflicts))
error("found" SPC %execFilePath SPC "duplicate file!"); error("found" SPC %execFilePath SPC "duplicate file!");
if (!%locked || (%locked && %isExclusive)) if (!%locked || (%locked && %isExclusive))
{ { // Replacing an existing entry, update in-place
ExecFilesList.erase(%i); ExecFilesList.setKey(%fullPath, %i);
ExecFilesList.setValue(%isExclusive, %i);
%locked = true; //Done, but don't return and bypass trace logging below
} }
break;
} }
} }
//if we're not locked, or we are exclusive, go ahead and add it to the pile //if we're not locked, go ahead and add it to the pile
//(ensures exclusives get re-added after that erasure) if (!%locked)
if (!%locked || %isExclusive)
ExecFilesList.add(%fullPath,%isExclusive); ExecFilesList.add(%fullPath,%isExclusive);
if ($traceModuleCalls) if ($traceModuleCalls)
ExecFilesList.echo(); ExecFilesList.echo();