struct ZObjInstance * __get_cur_error() { unsigned long thread_id = cur_thread; spinLock(&spin_lk); struct RBNode *stack = rbSearch(stack_tree, &thread_id); spinUnlock(&spin_lk); assert(to_stack(stack)->cur_error != NULL); return to_stack(stack)->cur_error; }
void __throw(struct ZObjInstance *e) { unsigned long thread_id = cur_thread; spinLock(&spin_lk); struct RBNode *stack = rbSearch(stack_tree, &thread_id); spinUnlock(&spin_lk); to_stack(stack)->cur_error = e; longjmp(to_stack(stack)->stack_top->jb, 1); }
void __pop_jmp_point() { unsigned long thread_id = cur_thread; spinLock(&spin_lk); struct RBNode *stack = rbSearch(stack_tree, &thread_id); spinUnlock(&spin_lk); struct stack_node *node = to_stack(stack)->stack_top; assert(node != NULL); to_stack(stack)->stack_top = node->prev; free(node); }
void * __push_jmp_point() { unsigned long thread_id = cur_thread; spinLock(&spin_lk); rbInsert(&stack_tree, &thread_id); spinUnlock(&spin_lk); struct RBNode *stack = rbSearch(stack_tree, &thread_id); struct stack_node *new_node = malloc(sizeof(struct stack_node)); assert(new_node != NULL); new_node->prev = to_stack(stack)->stack_top; to_stack(stack)->stack_top = new_node; return new_node->jb; }
void LYstore_message(const char *message) { if (message != NULL) { char *temp = NULL; StrAllocCopy(temp, message); to_stack(temp); } }
void LYstore_message2(const char *message, const char *argument) { if (message != NULL) { char *temp = NULL; HTSprintf0(&temp, message, NonNull(argument)); to_stack(temp); } }
static void * get_thread_id(struct RBNode *node) { return &to_stack(node)->thread_id; }