Skip to content

Commit 4a8220d

Browse files
authored
Fixes #2631 StartableProcess with overridden priority (#2632)
1 parent 22347a1 commit 4a8220d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/OSPSuite.Core/Services/StartableProcess.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,17 @@ public StartableProcess(string applicationPath, params string[] arguments)
3636
/// </summary>
3737
public int ReturnCode => _process.ExitCode;
3838

39-
public virtual void Start()
39+
/// <summary>
40+
/// Starts the process with the specified <paramref name="priority"/>, if provided. Otherwise, the current process priority is inherited
41+
/// </summary>
42+
public virtual void Start(ProcessPriorityClass? priority = null)
4043
{
4144
_process?.Start();
45+
if (!priority.HasValue)
46+
return;
47+
48+
if(_process != null)
49+
_process.PriorityClass = priority.Value;
4250
}
4351

4452
public void Dispose()

0 commit comments

Comments
 (0)