public PSWorkflowJobManager GetJobManager() { PSWorkflowJobManager pSWorkflowJobManager; if (this._jobManager == null) { lock (this._syncObject) { if (this._jobManager == null) { this._jobManager = PSWorkflowRuntime.Instance.JobManager; return(this._jobManager); } else { pSWorkflowJobManager = this._jobManager; } } return(pSWorkflowJobManager); } else { return(this._jobManager); } }
internal void SetWorkflowJobManager(PSWorkflowJobManager wfJobManager) { lock (syncLock) { jobManager = wfJobManager; } }
internal void SetWorkflowJobManager(PSWorkflowJobManager wfJobManager) { lock (PSWorkflowRuntime.syncLock) { this.jobManager = wfJobManager; } }
/// <summary> /// Disope implementation. /// </summary> /// <param name="disposing"></param> private void Dispose(bool disposing) { if (_isDisposed || !disposing) { return; } lock (_syncObject) { if (_isDisposed) { return; } // Suspend all running jobs then dispose all runspace providers if (jobManager != null) { jobManager.Dispose(); } jobManager = null; var remoteRunspaceProvider = _runspaceProvider as ConnectionManager; if (remoteRunspaceProvider != null) { remoteRunspaceProvider.Dispose(); } _runspaceProvider = null; var localRunspaceProvider = _localRunspaceProvider as LocalRunspaceProvider; if (localRunspaceProvider != null) { localRunspaceProvider.Dispose(); } _localRunspaceProvider = null; var unboundedLocalRunspaceProvider = _localRunspaceProvider as LocalRunspaceProvider; if (unboundedLocalRunspaceProvider != null) { unboundedLocalRunspaceProvider.Dispose(); } _unboundedLocalRunspaceProvider = null; activityHostController = null; _isDisposed = true; } }
/// <summary> /// GetJobManager /// </summary> /// <returns></returns> public PSWorkflowJobManager GetJobManager() { if (_jobManager != null) { return(_jobManager); } lock (_syncObject) { if (_jobManager != null) { return(_jobManager); } _jobManager = PSWorkflowRuntime.Instance.JobManager; } return(_jobManager); }