|
|
|
|
|
USING IN (Critical section) In french: UTILISER DANS
The statement USING ... IN makes it possible to automatically perform initialization and ending 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.
S is CriticalSection
utiliser S IN
END
// Use of a named critical section UTILISCriticalSection("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
UTILISCriticalSection(t) IN // Operations on the array by one only thread at a time ... END
Syntax
Defining a critical section using a CriticalSection variable Hide the details
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 Hide the details
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" Hide the details
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>.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|