I’ve one word for you, just one word… frames.

Amazing how simple it is to completely bust the CFLOCK tag. First, you create a simple page that has frames and loads another page into each frame.

<html>
<head>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="expires" content="tue, 04 jan 2000 1:00:00 gmt">
	<cfheader name="cache-control" value="no-cache, no-store, must-revalidate">
</head>
<frameset rows="1" cols="*,*">
	<frame src="thread.cfm?id=1">
	<frame src="thread.cfm?id=2">
</frameset>
</html>

Now for the code that is supposed to lock in the first frame, then release and then get picked up subsequently by the second frame.

<cfoutput>
<html>
<head>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="expires" content="tue, 04 jan 2000 1:00:00 gmt">
	<cfheader name="cache-control" value="no-cache, no-store, must-revalidate">
</head>
<body>
	<cflock name="globallockthatbreaks" type="exclusive" timeout="10" throwontimeout="true">
		#id#: got lock @ #timeformat(now(), "hh:mm:ss")#-#gettickcount()#<p>

		
		<cflock name="globallockthatbreaks" type="exclusive" timeout="10" throwontimeout="true"/>

		 
		<cflock name="stall_out_#id#" throwontimeout="yes" timeout="1" type="readonly">
			<cftry><cflock name="stall_out_#id#" throwontimeout="no" timeout="2" type="exclusive" /><cfcatch/></cftry>
		</cflock>

		#id#: give up lock @ #timeformat(now(), "hh:mm:ss")#<p>
	</cflock>
</body>
</html>
</cfoutput>

If you run this simple code, you’ll see that the lock is not honored and the threads in each frame are run simultaneously.