Exemplo n.º 1
0
static void *
thread_trampoline(void *aux)
{
    trampoline_t *t = aux;
    void *r;

#if defined(linux)
    if(posix_set_thread_priorities)
        setpriority(PRIO_PROCESS, syscall(224), t->prio);
    prctl(PR_SET_NAME, t->title, 0, 0, 0);
#elif defined(APPLE)
    pthread_setname_np(t->title);
#endif

    r = t->func(t->aux);
#if ENABLE_EMU_THREAD_SPECIFICS
    hts_thread_exit_specific();
#endif
    if(gconf.enable_thread_debug)
        TRACE(TRACE_DEBUG, "thread", "Thread %s exited", t->title);

    free(t->title);
    free(t);
    return r;
}
Exemplo n.º 2
0
static void *
thread_trampoline(void *aux)
{
  trampoline_t *t = aux;
  void *r;

#ifdef linux
  prctl(PR_SET_NAME, t->title, 0, 0, 0);
#endif
  free(t->title);

  r = t->func(t->aux);
#if ENABLE_EMU_THREAD_SPECIFICS
  hts_thread_exit_specific();
#endif

  free(t);
  return r;
}
Exemplo n.º 3
0
static void *
thread_trampoline(void *aux)
{
  trampoline_t *t = aux;
  void *r;

  JNIEnv *jenv = NULL;
  (*JVM)->AttachCurrentThread(JVM, &jenv, NULL);

  r = t->func(t->aux);

#if ENABLE_EMU_THREAD_SPECIFICS
  hts_thread_exit_specific();
#endif
  if(gconf.enable_thread_debug)
    TRACE(TRACE_DEBUG, "thread", "Thread %s exited", t->title);

  (*JVM)->DetachCurrentThread(JVM);

  free(t->title);
  free(t);
  return r;
}