Example #1
0
static int
c_main_thread_run(struct c_main_ctx *m_ctx)
{

    switch(m_ctx->cmn_ctx.run_state) {
    case THREAD_STATE_PRE_INIT:
        signal(SIGPIPE, SIG_IGN);
        m_ctx->cmn_ctx.run_state = THREAD_STATE_FINAL_INIT;
        break;
    case THREAD_STATE_FINAL_INIT:
        return c_main_thread_final_init(m_ctx);
    case THREAD_STATE_RUNNING:
        return c_thread_event_loop((void *)m_ctx);
    }
    return 0;
}
Example #2
0
static int
c_main_thread_run(struct c_main_ctx *m_ctx)
{

    switch(m_ctx->cmn_ctx.run_state) {
    case THREAD_STATE_PRE_INIT:
	// Kajal: This is for spurious signal handling
        signal(SIGPIPE, SIG_IGN);
        m_ctx->cmn_ctx.run_state = THREAD_STATE_FINAL_INIT;
        break;
    case THREAD_STATE_FINAL_INIT:
        return c_main_thread_final_init(m_ctx);
    case THREAD_STATE_RUNNING:
        return c_thread_event_loop_lib_support((void *)m_ctx);
    }
    return 0;
}