Unresolved
Details
Assignee
Michael OffnerMichael OffnerReporter
Zac SpitzerZac SpitzerPriority
NewFix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Zac Spitzer
Zac SpitzerPriority
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Created 18 October 2022 at 15:33
Updated 30 October 2024 at 12:35
1. unscoped, thread scoped variables aren't being resolved inside a thread
https://docs.lucee.org/guides/developing-with-lucee-server/scope.html
https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/lucee/runtime/type/scope/UndefinedImpl.java#L215
2. implicit scope access, reports thread scope when accessing a thread scoped variable within a thread?
<cfscript> echo("<h1>" & server.lucee.version & "</h1>"); s = getTickCount(); url.bingo = 1; dump(var=bingo, label="unscoped url access outside thread"); function napASecond(idx) localmode=true { var _index = duplicate(arguments.idx); thread._idx = _index; dump(var=thread, label="#_index#) thread scope before thread()"); thread name="thread-#_index#" { //thread.index = index*1000; //dump(var=thread, label="#_index#) thread access inside thread #thread.name# START"); thread._start=now(); sleep(500) thread._end=now(); thread.vars = structKeyList(thread); dump(var=thread, label="#thread.name#) thread access inside thread"); dump(var=bingo, label="#thread.name#) unscoped url access inside thread FINISH"); thread.implicitAccess = getPageContext().getDebugger().getDebuggingData(getPageContext()).implicitAccess; dump(var=_start, label="#thread.name#) unscoped thread access inside thread"); // should resolve to thread._start } dump(var=thread, label="#_index#) thread scope after thread()"); } start=getTickCount(); loop from=1 to=2 index="loopIndex" { napASecond(loopIndex); } function dumpThreads(threads, label){ echo("<h2>" & arguments.label & "</h2>"); for (var _t in arguments.threads){ //dump(arguments); dump(var=arguments.threads[_t], label="#_t#"); echo("<blockquote>" & arguments.threads[_t].output & "</blockquote>"); echo("<hr>"); } } // show threads dumpThreads(cfthread, "Before Threads joined"); // wait for all threads to finish thread action="join" name=cfthread.keyList(); // show threads dumpThreads(cfthread, "After Threads joined"); dump("done in #getTickCount()-start#ms"); dump(getPageContext().getDebugger().getDebuggingData(getPageContext()).implicitAccess); </cfscript>