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
  • Equivalence
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Locks the current thread until the semaphore is opened (which means until a "free" spot becomes available in the protected section).
Reminder: Semaphores can be used to define a protected area of code that can only be executed by a specific number of threads.
Syntax
<Result> = SemaphoreStart(<Semaphore name> [, <Maximum timeout>])
<Result>: Boolean
  • True if the thread is allowed to enter in the code section,
  • False otherwise (maximum duration reached).
<Semaphore name>: Character string
Name of semaphore to use. If the semaphore does not exist, it is created with the default options (see SemaphoreCreate)
<Maximum timeout>: Optional integer or optional duration
Maximum timeout in hundredths of a second.
  • At the end of the specified duration, if the thread did not receive the authorization, <Result> is set to False.
  • If this parameter is not specified or if it corresponds to the Infinite constant, the wait is infinite.
  • If this parameter is set to 0, <Result> corresponds to the status of the semaphore. The thread is not pending.
This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • the duration in a readable format (e.g., 1 s or 10 ms).
Remarks

Equivalence

SemaphoreStart("SemaphoreName")
is equivalent to:
CriticalSectionStart("MyCriticalSection")
By default, SemaphoreStart creates a semaphore limited to a single thread.
Component: wd300vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/30/2024

Send a report | Local help