Skip to content

Instantly share code, notes, and snippets.

@jamiejackson
Last active October 7, 2022 17:11
Show Gist options
  • Save jamiejackson/c50e8da82f3858abd61beac0b70bdf3c to your computer and use it in GitHub Desktop.
Save jamiejackson/c50e8da82f3858abd61beac0b70bdf3c to your computer and use it in GitHub Desktop.
<cfscript>
thread name="createObjectThread" {
thread.hello = "foo";
sleep(40);
}
keepLooping = true;
loopTimeout = 20; // (ms)
while (keepLooping) {
if (createObjectThread.elapsedTime > loopTimeout) {
keepLooping = false;
threadTerminate('createObjectThread');
}
sleep(5);
}
if (createObjectThread.status == "Terminated") {
writeDump("Thread was terminated after #createObjectThread.elapsedTime#ms. (Timeout is #loopTimeout#ms.)")
} else {
writeDump("Thread completed in #createObjectThread.elapsedTime#ms.")
}
writeDump(createObjectThread);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment