NetworkSuite.LeaveCriticalSection Method

Applies to TestComplete 14.50, last modified on April 22, 2021

Description

The LeaveCriticalSection makes the current project leave a critical section making it possible for other projects to access this critical section.

Declaration

NetworkSuite.LeaveCriticalSection(Name)

Name [in]    Required    String    
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

Name

Specifies the name of the needed critical section (case-insensitive).

Result Value

None.

Remarks

To request access to a critical section, use the NetworkSuite.EnterCriticalSection method.

Example

The following script halts the network suite's execution if the script doesn't get access to the CS1 critical section within the specified period.

JavaScript, JScript

if (NetworkSuite.EnterCriticalSection("CS1", 600000))
{
  ...
  NetworkSuite.LeaveCriticalSection("CS1");
}
else
  NetworkSuite.Stop();

Python

if NetworkSuite.EnterCriticalSection("CS1", 600000):
  # ...
  NetworkSuite.LeaveCriticalSection("CS1")
else:
  NetworkSuite.Stop()

VBScript

If NetworkSuite.EnterCriticalSection("CS1", 600000) = True Then
  ...
  NetworkSuite.LeaveCriticalSection "CS1"
Else
  NetworkSuite.Stop
End If

DelphiScript

if NetworkSuite.EnterCriticalSection('CS1', 600000) then
begin
  ...
  NetworkSuite.LeaveCriticalSection('CS1');
end
else
  NetworkSuite.Stop;

C++Script, C#Script

if (NetworkSuite["EnterCriticalSection"]("CS1", 600000))
{
  ...
  NetworkSuite["LeaveCriticalSection"]("CS1");
}
else
  NetworkSuite["Stop"]();

See Also

Distributed Testing
NetworkSuite.EnterCriticalSection
Critical Sections

Highlight search results