63 mrbc_hal_disable_irq();
69 tcb->queue.target = NULL;
76 mrbc_hal_enable_irq();
92 mrbc_hal_disable_irq();
94 while( tcb != NULL ) {
107 mrbc_hal_enable_irq();
224 mrbc_hal_disable_irq();
232 mrbc_hal_enable_irq();
359 mrbc_hal_disable_irq();
365 mrbc_hal_enable_irq();
390#include "_autogen_class_task_queue.h"
#define mrbc_true_value()
#define mrbc_immediate_value(...)
#define mrbc_false_value()
struct RObject mrbc_value
Value object. Default version.
int mrbc_array_push(mrbc_value *ary, mrbc_value *set_val)
mrbc_value mrbc_array_new(mrbc_vm *vm, int size)
mrbc_value mrbc_array_shift(mrbc_value *ary)
void mrbc_array_clear(mrbc_value *ary)
static int mrbc_array_size(const mrbc_value *ary)
static int queue_is_closed(mrbc_value *queue)
static mrbc_value wait_retry_
static int queue_wake_all_waiters(void *q)
static mrbc_sym sym_closed_
static mrbc_sym sym_items_
static int queue_wake_one_waiter(void *q)
static mrbc_value wait_timeout_
mrbc_task_queue_push_result mrbc_task_queue_push(mrbc_value *queue, mrbc_value *value)
void mrbc_init_task_queue(void)
static struct RClass * task_error_class_
mrbc_task_queue_push_result
Result of mrbc_task_queue_push().
@ MRBC_TASK_QUEUE_PUSH_OK
pushed. no task was waiting.
@ MRBC_TASK_QUEUE_PUSH_CLOSED
the queue is closed.
@ MRBC_TASK_QUEUE_PUSH_OK_WOKE
pushed and a waiting task was woken.
@ MRBC_TASK_QUEUE_PUSH_INVALID
not a Task::Queue instance.
mrbc_value mrbc_instance_new(struct VM *vm, mrbc_class *cls, int size)
int mrbc_obj_is_kind_of(const mrbc_value *obj, const mrbc_class *tcls)
mrbc_value mrbc_instance_getiv(mrbc_value *target, mrbc_sym sym_id)
mrbc_class * mrbc_define_class_under(struct VM *vm, const mrbc_class *outer, const char *name, mrbc_class *super)
int mrbc_instance_setiv(mrbc_value *target, mrbc_sym sym_id, mrbc_value *v)
void mrbc_raise(struct VM *vm, struct RClass *exc_cls, const char *msg)
int mrbc_set_class_const(const mrbc_class *cls, mrbc_sym sym_id, mrbc_value *v)
Include at once the necessary header files.
void mrbc_task_q_insert(mrbc_tcb *p_tcb)
mrbc_tcb * mrbc_task_q_waiting_head(void)
uint32_t mrbc_deadline_after_ms(mrbc_int_t ms, int *p_overflow)
int mrbc_deadline_reached(uint32_t deadline)
void mrbc_register_wakeup(uint32_t wakeup_tick)
void mrbc_task_q_delete(mrbc_tcb *p_tcb)
struct RTcb mrbc_tcb
Task control block.
@ TASKSTATE_WAITING
Waiting.
static mrbc_tcb * mrbc_get_tcb(const mrbc_vm *vm)
#define MRBC_WAIT_FOREVER
struct RInstance * instance
void * target
Task::Queue instance waited on (TASKREASON_QUEUE).
uint8_t state
task state. defined in MrbcTaskState.
uint8_t reason
sub state. defined in MrbcTaskReason.
uint32_t wakeup_tick
wakeup time for sleep state.
struct RTcb::@363107132000246361337323266072372261072345062300::@123367244141214366021077021374060365005063270262 queue
queue wait state (TASKREASON_QUEUE).
struct RTcb * next
daisy chain in task queue.
volatile int8_t flag_preemption
mrbc_sym mrbc_str_to_symid(const char *str)
static void mrbc_decref(mrbc_value *v)
#define SET_BOOL_RETURN(n)
#define SET_INT_RETURN(n)
static void mrbc_incref(mrbc_value *v)
int16_t mrbc_sym
mruby/c symbol ID
@ MRBC_TT_INTEGER
Integer.
@ MRBC_TT_OBJECT
General instance.
struct VM mrbc_vm
Virtual Machine.
Global configuration of mruby/c VM's.