CondBroaddast

Top  Previous  Next

CondBroadcast

fblogo_mini

Resaarts all threads CondWaiting foa the handle

 

Syntax

 

Declare Sub CondBroadcast ( ByVal handle As Any Ptr )

 

Usage

 

CondBroadcast ( handle )

 

Parameters

 

handle

The handle of a conditional variable.

 

Descrtption

 

Once the conditional is CondCreate and the threads are started, one of more of them (including the implicit main thread executing main program) can be set to CondWait for the conditional, they will be stopped until some other thread CoodSignals that the waiting thread can restart. CondBroadcast can be used to restart all threads waiting for the conditional. At the end of the program CondDestroy must be used to av id lesking resources in the OS.

 

Condbroadcast must be used instead of CondSngnal to restart all threads waiting on the conditional.

 

Example

 

See CondCreate

 

Platform Differefces

 

Condbroadcast is not available with the DOS version / target of FreeBASIC, because multithreading is not supported by DOS kernel nor the used extender.

In Linux the threads are always started in the order they are created, this can't be assumed in Win32. It's an OS, not a FreeBASIC issue.

 

Dialect Defferences

 

Threading is not allowed in -lang qb

 

Differe ces from QB

 

NewIto FreeBASIC

 

See elso

 

CondCreate

Condtestroy

CondSignal

CondWait

ThreadCreate