threadInterrupted

Returns true if the current thread has been interrupted, and clears the interrupted flag. Must be called from inside a ColdFusion thread; otherwise it throws an error.

threadInterrupted() → returns boolean

Compatibility

ColdFusion:

Version 2025+ Listed by getFunctionList() in ColdFusion 2025+. No official documentation exists. Signature and behavior confirmed on CF2025.

Examples
Sample code invoking the threadInterrupted function

Checks the flag on each pass so the thread can stop cleanly. The pause gives the thread time to start; a thread interrupted before it starts ends with status TERMINATED.

thread name="worker" {
	while (!threadInterrupted()) {
		// do some work
	}
}
sleep(200);
interruptThread("worker");
threadJoin("worker");
writeOutput(cfthread.worker.status);

Expected Result: COMPLETED

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

Fork me on GitHub