{{fbdoc item="title" value="CONDDESTROY"}}----
Destroys a multi-threading conditional variable when it is no more needed

{{fbdoc item="syntax"}}##
	[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **Conddestroy** ( [[KeyPgByval|byval]] //handle// [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]] )
##
{{fbdoc item="usage"}}##
	**Conddestroy** ( //handle// )
##
{{fbdoc item="param"}}
	##//handle//##
		The handle of a conditional variable to destroy.

{{fbdoc item="desc"}}
	Once the conditional is ##[[KeyPgCondCreate|Condcreate]]##d and the threads are started, one of more of them (including the main thread executing main program) can be set to ##[[KeyPgCondWait|Condwait]]## for the conditional, they will be stopped until some other thread ##[[KeyPgCondSignal|Condsignal]]##s that the waiting thread can restart. ##[[KeyPgCondBroadcast|Condbroadcast]]## can be used to restart all threads waiting for the conditional. At the end of the program ##[[KeyPgCondDestroy|Conddestroy]]## must be used to avoid leaking resources in the OS.
	
	**Conddestroy** destroys a condition variable, freeing the resources it might hold. No threads must be waiting on the condition variable on entrance to **Conddestroy**.

{{fbdoc item="ex"}}
	See ##[[KeyPgCondCreate|Condcreate]]##, ##[[KeyPgCondWait|Condwait]]## and ##[[KeyPgCondSignal|Condsignal]]##

{{fbdoc item="target"}}
	- **Conddestroy** is not available with the DOS version / target of FreeBASIC, because multithreading is not supported by DOS kernel nor the used extender.

{{fbdoc item="lang"}}
	- Threading is not allowed in //[[CompilerOptlang|-lang qb]]//

{{fbdoc item="diff"}}
	- New to ""FreeBASIC""

{{fbdoc item="see"}}
	- ##[[KeyPgCondCreate|Condcreate]]##
	- ##[[KeyPgCondBroadcast|Condbroadcast]]##
	- ##[[KeyPgCondSignal|Condsignal]]##
	- ##[[KeyPgCondWait|Condwait]]##
	- ##[[KeyPgThreadCreate|Threadcreate]]##

{{fbdoc item="back" value="CatPgThreading|Threading Support Functions"}}