|
|
|
|
|
USING IN (Critical section)
The instruction USE ... IN instruction automatically performs initialization and termination operations on critical sections. This statement makes it possible to "forget" these operations (mainly ending operations) and to make the code more readable for highlighting the block to which the functionality relates. Note: If the USE ... IN INSTRUCTION instruction via a RETURN instruction, the section is automatically ended.
Section is CriticalSection
Use Section IN
END
// Use of a named critical section USING CriticalSection("MySection") IN // Two threads will not be able to run this code at the same time ... END
// Critical section on a variable t is array <critical section> of int
USING CriticalSection(t) IN // Operations on the array by one only thread at a time ... END
Sintaxis
Defining a critical section using a CriticalSection variable Ocultar los detalles
USING <Critical Section> IN
... END
<USING IN>: Marks the beginning of the statement block. <Critical Section>: CriticalSection variable Name of the CriticalSection variable used to identify the critical section. <USING IN>: Marks the beginning of the statement block. <CriticalSection>: Enables the critical section. For more details, see CriticalSection.
Defining a named critical section Ocultar los detalles
USING CriticalSection(<Section name>) IN
... END
<USING IN>: Marks the beginning of the statement block. <CriticalSection>: Enables the critical section. For more details, see CriticalSection. <Section name>: Character string Identifies the critical section. This parameter is used to identify the protected code sections.
Defining a critical section on a variable with the extension attribute "Critical section" Ocultar los detalles
USING CriticalSection(<Variable>) IN
... END
<USING IN>: Marks the beginning of the statement block. <CriticalSection>: Enables the critical section. For more details, see CriticalSection. <Variable>: Any type Name of WLanguage variable that must be protected in a critical section. This variable must be defined with the extension attribute <critical section>.
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|