Example #1
0
/**
 * Sends a SIGINT to all processes/threads.
 */
void rec_sched_exit_all()
{
	while (!CIRCLEQ_EMPTY(&head)) {
		struct tasklist_entry* entry = CIRCLEQ_FIRST(&head);
		struct task* t = &entry->t;

		sys_kill(t->tid, SIGINT);
		rec_sched_deregister_thread(&t);
	}
}
Example #2
0
static void get_prompt_str(struct gstr *r, struct property *prop,
                           struct jk_head *head)
{
    int i, j;
    struct menu *submenu[8], *menu, *location = NULL;
    struct jump_key *jump;

    str_printf(r, _("Prompt: %s\n"), _(prop->text));
    str_printf(r, _("  Defined at %s:%d\n"), prop->menu->file->name,
               prop->menu->lineno);
    if (!expr_is_yes(prop->visible.expr)) {
        str_append(r, _("  Depends on: "));
        expr_gstr_print(prop->visible.expr, r);
        str_append(r, "\n");
    }
    menu = prop->menu->parent;
    for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
        bool accessible = menu_is_visible(menu);

        submenu[i++] = menu;
        if (location == NULL && accessible)
            location = menu;
    }
    if (head && location) {
        jump = malloc(sizeof(struct jump_key));

        if (menu_is_visible(prop->menu)) {
            /*
             * There is not enough room to put the hint at the
             * beginning of the "Prompt" line. Put the hint on the
             * last "Location" line even when it would belong on
             * the former.
             */
            jump->target = prop->menu;
        } else
            jump->target = location;

        if (CIRCLEQ_EMPTY(head))
            jump->index = 0;
        else
            jump->index = CIRCLEQ_LAST(head)->index + 1;

        CIRCLEQ_INSERT_TAIL(head, jump, entries);
    }

    if (i > 0) {
        str_printf(r, _("  Location:\n"));
        for (j = 4; --i >= 0; j += 2) {
            menu = submenu[i];
            if (head && location && menu == location)
                jump->offset = r->len - 1;
            str_printf(r, "%*c-> %s", j, ' ',
                       _(menu_get_prompt(menu)));
            if (menu->sym) {
                str_printf(r, " (%s [=%s])", menu->sym->name ?
                           menu->sym->name : _("<choice>"),
                           sym_get_string_value(menu->sym));
            }
            str_append(r, "\n");
        }
    }
}