32 #ifndef _QORE_INTERN_THREADLOCALVARIABLEDATA_H
33 #define _QORE_INTERN_THREADLOCALVARIABLEDATA_H
35 class ThreadLocalVariableData :
public ThreadLocalData<LocalVarValue> {
39 ThreadLocalVariableData::iterator i(curr);
41 sdh.
deref(i.get().finalize());
50 while (curr->prev || curr->pos)
54 DLLLOCAL LocalVarValue* instantiate() {
55 if (curr->pos == QORE_THREAD_STACK_BLOCK) {
59 curr->next =
new Block(curr);
64 return &curr->var[curr->pos++];
68 uninstantiateIntern();
70 curr->var[curr->pos].uninstantiate(xsink);
73 DLLLOCAL
void uninstantiateSelf() {
74 uninstantiateIntern();
75 curr->var[curr->pos].uninstantiateSelf();
78 DLLLOCAL
void uninstantiateIntern() {
91 DLLLOCAL LocalVarValue* find(
const char*
id) {
97 LocalVarValue* var = &w->var[p];
98 if (var->id ==
id && !var->frame_boundary)
105 printd(0,
"ThreadLocalVariableData::find() this: %p no local variable '%s' (%p) on stack (pgm: %p) p: %d\n",
this,
id,
id,
getProgram(), p);
107 printd(0,
"var p: %d: %s (%p) (frame_boundary: %d)\n", p, curr->var[p].id, curr->var[p].id, curr->var[p].frame_boundary);
118 DLLLOCAL
void pushFrameBoundary() {
121 LocalVarValue* v = instantiate();
122 v->setFrameBoundary();
125 DLLLOCAL
void popFrameBoundary() {
126 assert(frame_count >= 0);
129 uninstantiateIntern();
130 assert(curr->var[curr->pos].frame_boundary);
131 curr->var[curr->pos].frame_boundary =
false;
134 DLLLOCAL
int getFrame(
int frame, Block*& w,
int& p);
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
This is the hash or associative list container type in Qore, dynamically allocated only,...
Definition: QoreHashNode.h:50
Helps dereference values outside of locks.
Definition: QoreLibIntern.h:543
DLLLOCAL void deref(QoreValue v)
dereferences the value immediately if it cannot throw an exception, or adds it to the list for derefe...
Definition: QoreLibIntern.h:559
DLLEXPORT QoreProgram * getProgram()
returns the current QoreProgram
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275