PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
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.
Example
Versions 24 and later
// Using a Critical Section variable
S is CriticalSection

// Use for a code block
//---------------------------
UTILISSRIN
// code protected by the critical section
// only one thread will execute this code at a given moment
END
New in version 24
// Using a Critical Section variable
S is CriticalSection

// Use for a code block
//---------------------------
UTILISSRIN
// code protected by the critical section
// only one thread will execute this code at a given moment
END
// Using a Critical Section variable
S is CriticalSection

// Use for a code block
//---------------------------
UTILISSRIN
// code protected by the critical section
// only one thread will execute this code at a given moment
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
Versions 24 and later

Defining a critical section using a CriticalSection variable Hide the details

USING <Critical Section> IN

    ...
END
<USING IN>:
Marks the beginning of statement block.
<Critical Section>: CriticalSection variable
Name of the variable used to identify the critical section.
New in version 24

Defining a critical section using a CriticalSection variable Hide the details

USING <Critical Section> IN

    ...
END
<USING IN>:
Marks the beginning of statement block.
<Critical Section>: CriticalSection variable
Name of the variable used to identify the critical section.

Defining a critical section using a CriticalSection variable Hide the details

USING <Critical Section> IN

    ...
END
<USING IN>:
Marks the beginning of statement block.
<Critical Section>: CriticalSection variable
Name of the variable used to identify the critical section.

Defining a global section Hide the details

USING CriticalSection() IN
    ...
END
<USING IN>:
Marks the beginning of statement block.
<CriticalSection>:
Enables the critical section. See for more details.

Defining a named critical section Hide the details

USING CriticalSection(<Name of the section>) IN

    ...
END
<USING IN>:
Marks the beginning of statement block.
<CriticalSection>:
Enables the critical section. See for more details.
<Section name>: Character string with quotes)
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 statement block.
<CriticalSection>:
Enables the critical section. See for more details.
<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>.
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment