ThreadWait
Waits for a thread to finish execution and releases the thread handle
ThreadWait( id )
ThreadWait waits for a thread created by ThreadCreate or Threadcall to finish execution, and then releases the resources associated with the thread handle. ThreadWait does not return until the thread designated by id ends.
In order to release a thread handle without waiting for the thread to finish, use Threaddetach.
ThreadWait does not force the thread to end; if a thread requires a signal to force its end, a mechanism such as shared variables and mutexes must be used.
Syntax
Usage
ThreadWait( id )
Parameters
Description
ThreadWait waits for a thread created by ThreadCreate or Threadcall to finish execution, and then releases the resources associated with the thread handle. ThreadWait does not return until the thread designated by id ends.
In order to release a thread handle without waiting for the thread to finish, use Threaddetach.
ThreadWait does not force the thread to end; if a thread requires a signal to force its end, a mechanism such as shared variables and mutexes must be used.
Example
Dialect Differences
- Threading is not allowed in the -lang qb dialect.
Platform Differences
- ThreadWait is not available with the DOS version of FreeBASIC, because multithreading is not supported by DOS kernel nor the used extender.
Differences from QB
- New to FreeBASIC
See also