PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
Versions 17 and later
Universal Windows 10 App Most of these functions are now available for the Windows Phone applications.
New in version 17
Universal Windows 10 App Most of these functions are now available for the Windows Phone applications.
Universal Windows 10 App Most of these functions are now available for the Windows Phone applications.
Versions 18 and later
Universal Windows 10 App Most of these functions are now available in Windows Store apps mode.
Android Widget Most of these functions are now available in Android Widget mode.
New in version 18
Universal Windows 10 App Most of these functions are now available in Windows Store apps mode.
Android Widget Most of these functions are now available in Android Widget mode.
Universal Windows 10 App Most of these functions are now available in Windows Store apps mode.
Android Widget Most of these functions are now available in Android Widget mode.
Versions 19 and later
iPhone/iPad Most of these functions are now available for the iPhone/iPad applications.
WINDEVLinux Most of these functions are now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux Most of these functions are now available for the WEBDEV sites in Linux.
New in version 19
iPhone/iPad Most of these functions are now available for the iPhone/iPad applications.
WINDEVLinux Most of these functions are now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux Most of these functions are now available for the WEBDEV sites in Linux.
iPhone/iPad Most of these functions are now available for the iPhone/iPad applications.
WINDEVLinux Most of these functions are now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux Most of these functions are now available for the WEBDEV sites in Linux.
Versions 21 and later
Universal Windows 10 App Most of these functions are now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App Most of these functions are now available in Universal Windows 10 App mode.
Universal Windows 10 App Most of these functions are now available in Universal Windows 10 App mode.
The following functions are used to manage the threads:
CriticalSectionEndMarks the end of critical section: the code will be run by another thread.
CriticalSectionStartMarks the start of a critical section: no other thread will be able to run the code as long as the current thread does not exit from the critical section.
EventChangeModifies the status of a signal.
EventCloseCloses a synchronization signal between several threads.
EventCreateCreates a signal.
EventDestroyExplicitly destroys a signal.
EventOpenOpens a synchronization signal between several threads.
EventWaitLocks the current thread while waiting for the specified signal to be opened.
ExecuteMainThreadTriggers the execution of the procedure specified in the main application thread.
MutexCreateExplicitly creates a mutex.
MutexDestroyExplicitly destroys a mutex.
MutexEndSignals that the thread frees the mutex.
MutexStartLocks the current thread while waiting for the mutex to be freed.
SemaphoreCreateCreates a semaphore.
SemaphoreDestroyExplicitly destroys a semaphore.
SemaphoreEndAllows one or more threads to exit from the area protected by the semaphore.
SemaphoreStartLocks the current thread until the semaphore is opened (which means until a "free" spot becomes available in the protected section).
ThreadCurrentReturns the name of the thread currently run.
ThreadEndEnds the execution of the current thread.
ThreadExecuteStarts the execution of a secondary thread.
ThreadModeChanges the management mode of threads.
ThreadPausePauses the current thread during the specified duration.
ThreadPersistentMakes a thread persistent.
ThreadPriorityReturns or modifies the priority level of a thread.
ThreadResumeResumes the execution of a thread that was interrupted by ThreadSuspend.
ThreadSendSignalThe current thread sends a signal to the specified thread in order to unlock it.
ThreadStateReturns the current status of a thread.
ThreadStopStops a secondary thread.
ThreadSuspendTemporarily suspends the execution of the specified thread.
ThreadWaitWaits for the end of execution of specified thread.
ThreadWaitSignalLocks the current thread until it receives a signal from another thread.
Versions 20 and later
You also have the ability to use the following types of variables:
Versions 20 and later
AutomaticEvent
New in version 20
AutomaticEvent
AutomaticEvent
The AutomaticEvent type is used to manage an automatic signal.
Versions 20 and later
ManualEvent
New in version 20
ManualEvent
ManualEvent
The ManualEvent type is used to manage a manual signal.
New in version 20
You also have the ability to use the following types of variables:
Versions 20 and later
AutomaticEvent
New in version 20
AutomaticEvent
AutomaticEvent
The AutomaticEvent type is used to manage an automatic signal.
Versions 20 and later
ManualEvent
New in version 20
ManualEvent
ManualEvent
The ManualEvent type is used to manage a manual signal.
You also have the ability to use the following types of variables:
Versions 20 and later
AutomaticEvent
New in version 20
AutomaticEvent
AutomaticEvent
The AutomaticEvent type is used to manage an automatic signal.
Versions 20 and later
ManualEvent
New in version 20
ManualEvent
ManualEvent
The ManualEvent type is used to manage a manual signal.
Related Examples:
The threads Unit examples (WINDEV Mobile): The threads
[ + ] Using threads in an application:
- run a procedure in thread format
- stop a thread
- run a procedure that expects parameters in thread format
The threads Unit examples (WINDEV): The threads
[ + ] Using threads in an application:
- Run a procedure in thread format
- Stop a thread
- Run a procedure that expects parameters in thread format
The threads (pool) Unit examples (WINDEV): The threads (pool)
[ + ] Using threads:
- Running processes started in parallel
- Limiting the number of threads in execution at a given time
Reminder: A thread is a process running in parallel to the current application (main thread).
This allows you to run a task in background task for example (backup, ...).
Threads are very useful in the industry: supervisor, applications with real-time process check, and so on …
The threads (pool) Unit examples (WINDEV Mobile): The threads (pool)
[ + ] Using threads with the WLanguage functions.
Two main topics are presented in this example:
1/ Run processes started in parallel (threads)
2/ Limit the number of threads in execution at a given time
Reminder: a "thread" is a process started in parallel of the current application (main "thread").
This allows you to run a task in background task for example (backup, ...).
Threads are very useful in the industry: supervisor, applications with real-time process check, and so on
WD Using sockets Training (WINDEV): WD Using sockets
[ + ] This example presents the use of the "Socket" functions of WINDEV in Client/Server.
The following topics are presented in this example:
1/ How to connect to a socket
2/ How to accept a request for connection
3/ How to write or read on a socket
Summary of the example supplied with WINDEV:
This example presents the different functions for socket management supplied with WINDEV. To use this example, a first instance of the example must be started in "server" mode. Then, by specifying the name of the computer that will be used as server and a nickname, you can connect to this application in "client" mode. You now have the ability to send messages to all the connected users. In this example, a thread and a socket are associated with each connection.
WD Video surveillance Complete examples (WINDEV): WD Video surveillance
[ + ] This example explains how to broadcast images coming from a Web camera via a network (Intranet, Internet).
The following topics are presented in this example:
1/ Web Camera control
2/ Using the Socket functions
3/ Using the Thread function
4/ Detecting movements
Summary of the example supplied with WINDEV:
This example is used to broadcast the images captured by a Web Camera via a network (Intranet, Internet)
This application groups the "Diffusion server" part and the "Monitor" part.
It allows you to:
- broadcast the images of the Web Camera
- select a "monitor"
- analyze the image to detect a movement. In this case, the relevant recipients (or "monitors") can be notified
- connect up to 8 different Web Cameras and enable the detection of movements
WD FTP File Transfer Complete examples (WINDEV): WD FTP File Transfer
[ + ] This example is a full FTP client allowing you to store several FTP servers. Then, you have the ability to perform multi-file transfers from the local computer to the server or from the FTP server to the local computer. To do so, we are using the standard functions of WLanguage (FTPConnect, etc.)
Android Persistent Notifications Android (WINDEV Mobile): Android Persistent Notifications
[ + ] This example is used to create persistent notifications that appear even if the application is not used anymore.
A persistent thread run when the starting device is used to send the notifications.
Minimum required version
  • Version 9
This page is also available for…
Comments
GetCurrentThreadId
You may also use the ExeGetPID function with the exeTID parameter.
See http://doc.pcsoft.fr/en-US/?exegetpid for more details.
PC SOFT
Apr. 28 2010
GetCurrentThreadId
If you want to know the thread id, use the following code:

PROCEDURE GetCurrentThreadId()
RESULT API("kernel32.dll","GetCurrentThreadId")

Useful for debugging thread code, dbgAssert'ing that only one thread is accessing global procedures/variables, etc.
Pascal Scheffers
Apr. 28 2010