PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Mode for sharing the semaphores
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
Creates a semaphore.
Reminder: The semaphores are used to define a protected code section that can only be run by a specific number of threads.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Versions 19 and later
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 19
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
iPhone/iPad This function is now available for the iPhone/iPad applications.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Create a semaphore
SemaphoreCreate("MySemaphore", 3)
Syntax
SemaphoreCreate(<Semaphore Name> [, <Authorization> [, <Use> [, <Options>]]])
<Semaphore Name>: Character string (with quotes)
Name of the semaphore to create. This name will be used by all the functions for semaphore management.
<Authorization>: Optional integer
Number of concurrent threads allowed in the protected section. This parameter is set to 1 by default.
<Use>: Optional integer
Number of threads found in the section when creating the semaphore (0 by default).
<Options>: Optional Integer constant
Mode for sharing the semaphore:
shareNoneThe semaphore is specific to the application. If SemaphoreDestroy is not called, the semaphore is destroyed at the end of the application.
AndroidAndroid Widget iPhone/iPadJava The semaphores are unique for the application that created them. They cannot be shared between several applications.
shareGlobalThe semaphore is shared among all the applications found on the computer.
AndroidAndroid Widget iPhone/iPadJava This constant is not available.
shareUser
(default value)
The semaphore is shared among all the applications of the session of the user who is running the application.
AndroidAndroid Widget iPhone/iPadJava This constant is not available.
Remarks
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileUniversal Windows 10 AppAjaxUser code (UMC)

Mode for sharing the semaphores

In shareUser mode, the semaphore is shared among all the applications of the session of the user who runs the application.
  • The semaphore is created by the first application of the session of the user who calls SemaphoreCreate.
  • The following applications that call SemaphoreCreate connect to the existing semaphore.
  • The last application that is closed destroys the semaphore.
  • A semaphore with the same name cannot be used by a session of another user on the same computer: the system returns an error of access rights.
In shareGlobal mode, the semaphore is shared among all the applications found on the computer.
  • The semaphore is created by the first application that calls SemaphoreCreate.
  • The following applications that call SemaphoreCreate connect to the existing semaphore.
  • The last application that is closed destroys the semaphore.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment