Given the following scenario, I would like to know if functionOneLock releases itself before functionTwoLock is triggered, or does it wait until functionTwoLock releases first?
<!--- functionOne() --->
<cffunction name="functionOne">
<cflock name="functionOneLock" type="exclusive">
<!--- do something --->
<cfset functionTwo()>
</cflock>
</cffunction>
<!--- functionTwo() --->
<cffunction name="functionTwo">
<cflock name="functionTwoLock" type="exclusive">
<!--- do something here --->
</cflock>
</cffunction>
I presume you are calling
functionOne()fromfunctionTwo(), like so:Since you are using named locks, your thread of execution will enter
functionOneLockthen within that call the other function thus enteringfunctionTwoLock. It will then complete the code within that lock before returning from that function and completingfunctionOneLock.So to answer your question
functionOneLockwill have to wait forfunctionTwoLockto complete.Hope that helps.