Example #1
0
void thread_exit(void)
{
    remove_thread(THREAD_ID_CURRENT);
    /* This should never and must never be reached - if it is, the
     * state is corrupted */
    THREAD_PANICF("thread_exit->K:*R",
                  thread_id_entry(THREAD_ID_CURRENT));
    while (1);
}
void thread_exit(void)
{
    unsigned int id = thread_self();
    remove_thread(id);
    /* This should never and must never be reached - if it is, the
     * state is corrupted */
    THREAD_PANICF("thread_exit->K:*R (ID: %d)", id);
    while (1);
}
Example #3
0
void init_threads(void)
{
    /* Main thread is already initialized */
    if (cores[CURRENT_CORE].running != &threads[0])
    {
        THREAD_PANICF("Wrong main thread in init_threads: %p\n",
                      cores[CURRENT_CORE].running);
    }

    THREAD_SDL_DEBUGF("First Thread: %d (%s)\n",
            0, THREAD_SDL_GET_NAME(&threads[0]));
}
Example #4
0
static int thread_sdl_app_main(void *param)
{
    SDL_LockMutex(m);
    cores[CURRENT_CORE].running = &threads[0];

    /* Set the jump address for return */
    if (setjmp(thread_jmpbufs[0]) == 0)
    {
        app_main(param);
        /* should not ever be reached but... */
        THREAD_PANICF("app_main returned!\n");
    }

    /* Unlock and exit */
    SDL_UnlockMutex(m);
    return 0;
}