parrotcode: Event handling stuff | |
Contents | C |
src/events.c - Event handling stuff
An event_thread handles async events for all interpreters.
When events are due,
they are placed in per interpreter task_queues,
where they are handled then by the check_event*
opcodes.
IO events and signals are caught in the io_thread, which again dispatches these to one or all interpreters.
static void sig_handler
signum
.TODO - Only SIGHUP
is handled at the moment for testing
static void Parrot_sigaction
static void Parrot_unblock_signal
void Parrot_init_signals
static void init_events_first
static void init_events_all
void Parrot_init_events
void Parrot_schedule_event
static void schedule_signal_event
void Parrot_new_timer_event
diff
from now,
repeated at interval
and running the passed sub
.
void Parrot_new_cb_event
void Parrot_del_timer_event
timer
.
void Parrot_new_terminate_event
void Parrot_new_suspend_for_gc_event
void Parrot_kill_event_loop
void Parrot_schedule_interp_qentry
void Parrot_schedule_broadcast_qentry
static void store_io_event
static void io_thread_ready_rd
static void *io_thread
static void stop_io_thread
void Parrot_event_add_io_event
static QUEUE_ENTRY *dup_entry
static QUEUE_ENTRY *dup_entry_interval
abs_time
.
static int process_events
static void *event_thread
static opcode_t *wait_for_wakeup
opcode_t *Parrot_sleep_on_event
sleep
opcode.opcode_t *Parrot_do_check_events
sync
called by the check_event opcode from run loops.
static void event_to_exception
static opcode_t *do_event
event
argument is freed after execution.TODO: Instrument with splint args so splint knows event gets released.
opcode_t *Parrot_do_handle_events
check_event__
opcode from run loops or from above.
When called from the check_events__
opcode,
we have to restore the op_func_table
.include/parrot/events.h and docs/dev/events.pod.
|