Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

LeaveCriticalSection

  • Last UpdatedJul 18, 2023
  • 1 minute read

Relinquishes the current thread's ownership of a critical section (shared critical resource). Once ownership is relinquished, access to the critical section is available to the next thread that requests it (using the EnterCriticalSection() function). If a thread has been waiting for access, it will be granted at this point.

LeaveCriticalSection() needs to be called once for each EnterCriticalSection() used.

Note: This function is process-based, not computer-based, and so will only prevent access to a critical section within a single process. This function only works between Cicode tasks within the same process.

Syntax

LeaveCriticalSection(sName)

sName:

The name of the critical section. The name needs to be entered in quotation marks.

Return Value

This function does not return a value.

EnterCriticalSection

Example

/* Request access to critical section, execute code and relinquish
ownership of critical section. */

FUNCTION

MyCriticalFunction()

EnterCriticalSection("MyCritical");

// critical code is placed here

LeaveCriticalSection("MyCritical");

END

See Also

Task Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in