which for now is only called from the "limit" keyword.
The thread instance data could arguably go into the stack frame,
but 99.9% of the stack frames won't use it. So for now we just
make the users call it manually
return 0;
}
+/** Get the thread-instance data for an instruction.
+ *
+ * @param[in] instruction the instruction to use
+ * @return a pointer to thread-local data
+ */
+void *unlang_thread_instance(unlang_t const *instruction)
+{
+ if (!instruction->number || !unlang_thread_array) return NULL;
+
+ fr_assert(instruction->number <= unlang_number);
+
+ return unlang_thread_array[instruction->number].thread_inst;
+}
+
#ifdef WITH_PERF
void unlang_frame_perf_init(unlang_stack_frame_t *frame)
{
#endif
} unlang_thread_t;
+void *unlang_thread_instance(unlang_t const *instruction);
+
#ifdef WITH_PERF
void unlang_frame_perf_init(unlang_stack_frame_t *frame);
void unlang_frame_perf_yield(unlang_stack_frame_t *frame);