icinga-powershell-framework/lib/core/thread/Start-IcingaThread.psm1

18 lines
483 B
PowerShell
Raw Normal View History

function Start-IcingaThread()
{
param(
[string]$Thread
);
if ([string]::IsNullOrEmpty($Thread)) {
return;
}
2021-12-09 11:42:06 -05:00
if ($Global:Icinga.Public.Threads.ContainsKey($Thread)) {
if ($Global:Icinga.Public.Threads[$Thread].Started -eq $FALSE) {
$Global:Icinga.Public.Threads[$Thread].Handle = $Global:Icinga.Public.Threads[$Thread].Shell.BeginInvoke();
$Global:Icinga.Public.Threads[$Thread].Started = $TRUE;
}
}
}