ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Process functions / Threads, semaphores, signals and mutex
  • Miscellaneous
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Marks the end of a critical section: another thread will be able to run the code.
To mark the start of critical section, use CriticalSectionStart.
iPhone/iPadApple Watch When the calls to CriticalSectionStart and CriticalSectionEnd are in the same section of the code, it is recommended to use the type CriticalSection and the syntax USE ... IN.
Example:
// Utilisation d'une variable de type Section Critique
S is CriticalSection

// Utilisation pour un bloc de code
//---------------------------
USING S IN
	// code protégé par la section critique
	// un seul thread pourra exécuter ce code à un moment donné
END
Example
iPhone/iPadApple Watch
// Section critique sur une variable
t is array <critical section> of int
CriticalSectionStart(t)
// Manipulations sur le tableau par un seul thread en même temps
CriticalSectionEnd(t)
// Utilisation d'une section critique nommée
CriticalSectionStart("MaSection")
// Deux threads ne pourront pas exécuter ce code en même temps
...
CriticalSectionEnd("MaSection")
Syntax
iPhone/iPadApple Watch

Ending a CriticalSection on a code section: using the CriticalSection type Hide the details

CriticalSectionStart(<Critical section>)
<Critical section>: CriticalSection variable
Name of the CriticalSection variable used to identify the critical section.
iPhone/iPadApple Watch

Ending a critical section on a variable Hide the details

CriticalSectionEnd([<Variable name>])
<Variable name>: Any type
Name of WLanguage variable that was protected in a critical section by CriticalSectionStart. This variable must be defined with the attribute <critical section>.

Ending a named critical section on a code section Hide the details

CriticalSectionEnd([<Section name>])
<Section name>: Optional character string
Identifies the critical section.
Remarks

Miscellaneous

  • For more details on critical sections, see Managing the critical sections.
  • If a thread is destroyed while it is found in a critical section, the critical section is automatically freed.
  • A single thread is allowed in all the sections with the same name.
  • If sections use a different name, a thread can run the code of one section while another thread runs the code of another section.
Component: wd300vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help