예제 #1
0
파일: time.c 프로젝트: libpake/CsKemeng-arm
void *action_run_thread( void *arg)
{
    int ret = -1;
    struct st_plan_action *plac = (struct st_plan_action *)arg;
    ret = action_run(plac);

    return (void *)ret;
}
예제 #2
0
void on_logout_now(GtkWidget *widget, gpointer data)
{
    if(confirm_dialog(values.action_logout) == TRUE) {
        gui_notification(_("Current session will be terminated !"), 
                         NOTIFICATION_TYPE_IMPORTANT, 
                         NOTIFICATION_ICON_TIME);
        action_run(values.action_logout);
    }
}
예제 #3
0
void on_reboot_now(GtkWidget *widget, gpointer data)
{
    if(confirm_dialog(values.action_restart) == TRUE) {
        gui_notification(_("Computer is going to reboot now !"), 
                         NOTIFICATION_TYPE_IMPORTANT, 
                         NOTIFICATION_ICON_TIME);
        action_run(values.action_restart);
    }
}
예제 #4
0
파일: graph_engine.c 프로젝트: jimiszm/peos
vm_exit_code set_act_state_graph(Graph g, char *action, vm_act_state state)
{
    int error;
    Node n;
    switch(state)
    {
        case ACT_DONE:
            return action_done(g,action);
        case ACT_READY:
            n = find_node(g,action);
            if (n!=NULL) {
                set_node_state(n, ACT_READY, &error);
                if (!error)
                    return VM_CONTINUE;
            }
            return VM_INTERNAL_ERROR;
        case ACT_RUN:
            if (action_run(g,action) >  0)
                return VM_CONTINUE;
            return VM_INTERNAL_ERROR;
        case ACT_NONE:
            n = find_node(g,action);
            if (n != NULL) {
                set_node_state(n, ACT_NONE, &error);
                if (!error)
                    return VM_CONTINUE;
            }
            return VM_INTERNAL_ERROR;
        case ACT_SUSPEND:
            n = find_node(g,action);
            if (n != NULL) {
                set_node_state(n, ACT_SUSPEND, &error);
                if (!error)
                    return VM_CONTINUE;
            }
            return VM_INTERNAL_ERROR;
        case ACT_ABORT:
            n = find_node(g,action);
            if (n != NULL) {
                if (STATE(n) == ACT_RUN) {
                    set_node_state(n, ACT_NONE, &error);
                    if (error)
                        return VM_INTERNAL_ERROR;
                    update_process_state(PID(n));
                }
                return VM_CONTINUE;
            }
            return VM_INTERNAL_ERROR;
        default :
            fprintf(stderr, "Error Changing Action : Invalid Action State\n");
            return -1;
    }
}
예제 #5
0
파일: graph_engine.c 프로젝트: jimiszm/peos
vm_exit_code action_done(Graph g, char *act_name)
{
    int error;
    Node n;
    Node child;
    int i,num_successors;
    vm_act_state state_set;

    if (action_run(g, act_name) == -1) return VM_INTERNAL_ERROR;
    n = find_node(g,act_name);
    if (n != NULL) {
        state_set = set_node_state(n, ACT_DONE, &error);
        if (error)
            return VM_INTERNAL_ERROR;
	num_successors = ListSize(n -> successors);
	for(i = 0; i < num_successors; i++) {
	    child = (Node) ListIndex(n -> successors, i);
	    /*
	     * (num_successors == 1) is a check to see that it is 
	     * not an iteration.
	     */
	    if (state_set == ACT_DONE) {
                if ((child -> type == JOIN) && (num_successors == 1)) {
	            propogate_join_done(child, state_set);
	        }
	    }
	    if (child -> type != RENDEZVOUS) {
		/* 
		 * if a child is not a rendezvous or a join, it has to 
		 * be a selection or branch or action, so mark it ready. If 
		 * its sink, that is handled again by set_process_state(..) 
		 */
	        mark_successors(child, ACT_READY);
	    }
	    else {
	        if (num_successors == 1)	
		set_rendezvous_state(child);
	    }
	}	    
	if (num_successors == 1)
	    set_process_state(g);
    }
    else {
        fprintf(stderr, "Error in action_done");
	return VM_INTERNAL_ERROR;
    }
    if (STATE(g->source) == ACT_DONE) {
        return VM_DONE;
    }
    else
        return VM_CONTINUE;
}
예제 #6
0
void arch_cpu_wait_for_action(void)
{
	struct cpu_info *ci = cpu_info();
	struct cpu_action_queue *q = &ci->action_queue;

	while (1) {
		struct cpu_action *orig;
		struct cpu_action action;

		orig = wait_for_action(q, &action);

		action_run(&action);
		action_queue_complete(q, orig);
	}
}
예제 #7
0
void on_progress_execute(GtkWidget *widget, gpointer data)
{
    gtk_widget_destroy(GTK_WIDGET(data));   
    action_run(values.current_action);
    on_btn_start_clicked(btn_start, NULL);
}