Description
Makes the current thread wait until the thread or threads specified complete processing.
Category
Exception handling functions, Data output functions
Makes the current thread wait until the thread or threads specified complete processing.
Exception handling functions, Data output functions
ThreadJoin([threadName], [timeout])
cfscript, cfthrow, cftry, cfcatch
ColdFusion 9: Added this function.
Parameter |
Description |
---|---|
threadName |
The name of the thread or threads to join to the current thread. To specify multiple threads, use a comma-separated list. |
timeout |
The number of milliseconds for which to suspend thread processing. |
Makes the current thread wait until the thread or threads specified in the {{threadName}}parameter complete processing, or until the period specified in the {{timeout}}parameter passes, before continuing processing.
<cfscript> thread name="t1" { sleep(5000); } thread name="t2" { threadjoin("t1",1000); } threadjoin("t2"); </cfscript> <cfoutput>Status of the thread T1 = #t1.Status#<br></cfoutput> <cfoutput>Status of the thread T2 = #t2.Status#<br></cfoutput>