isinthread

Determines whether the executing code is inside a cfthread or not.

isinthread() → returns boolean

This function requires Lucee 5.0 and up.  Not supported on Adobe ColdFusion, etc.

Examples
Sample code invoking the isinthread function

Check if the code is running inside a cfthread.

request.inthread = false;
writeOutput(isInThread());
thread action="run" name="inThread" {
 request.inthread = isInThread();
}
sleep(1000);
writeOutput(request.inthread)

Expected Result: falsetrue

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub