-/* threads_java_lang_Thread_set_priority ***********************************************************
-
- Set the priority for the given java.lang.Thread.
-
- IN:
- t............the java.lang.Thread
- priority.....the priority
-
-*******************************************************************************/
-
-void threads_java_lang_Thread_set_priority(java_lang_Thread *t, s4 priority)
-{
- threadobject *thread;
-
- thread = (threadobject*) t->vmThread;
-
- threads_set_thread_priority(thread->tid, priority);
-}
-
-
-/* threads_dump ****************************************************************
-
- Dumps info for all threads running in the JVM. This function is
- called when SIGQUIT (<ctrl>-\) is sent to CACAO.
-
-*******************************************************************************/
-
-void threads_dump(void)
-{
- threadobject *tobj;
- java_lang_VMThread *vmt;
- java_lang_Thread *t;
- utf *name;
-
- tobj = mainthreadobj;
-
- printf("Full thread dump CACAO "VERSION":\n");
-
- /* iterate over all started threads */
-
- do {
- /* get thread objects */
-
- vmt = &tobj->o;
- t = vmt->thread;
-
- /* the thread may be currently in initalization, don't print it */
-
- if (t) {
- /* get thread name */
-
- name = javastring_toutf(t->name, false);
-
- printf("\n\"");
- utf_display_printable_ascii(name);
- printf("\" ");
-
- if (t->daemon)
- printf("daemon ");
-
-#if SIZEOF_VOID_P == 8
- printf("prio=%d tid=0x%016lx\n", t->priority, tobj->tid);
-#else
- printf("prio=%d tid=0x%08lx\n", t->priority, tobj->tid);
-#endif
-
- /* send SIGUSR1 to thread to print stacktrace */
-
- pthread_kill(tobj->tid, SIGUSR1);
-
- /* sleep this thread a bit, so the signal can reach the thread */
-
- threads_sleep(10, 0);
- }
-
- tobj = tobj->next;
- } while (tobj && (tobj != mainthreadobj));
-}
-
-
-/* threads_table_dump *********************************************************
-
- Dump the threads table for debugging purposes.
-
- IN:
- file..............stream to write to
-
-******************************************************************************/
-
-#if !defined(NDEBUG)
-static void threads_table_dump(FILE *file)
-{
- s4 i;
- s4 size;
- ptrint index;
-
- pthread_mutex_lock(&threadlistlock);
-
- size = threads_table.size;
-
- fprintf(file, "======== THREADS TABLE (size %d) ========\n", size);
-
- for (i=0; i<size; ++i) {
- index = threads_table.table[i].nextfree;
-
- fprintf(file, "%4d: ", i);
-
- if (index < size) {
- fprintf(file, "free, nextfree = %d\n", index);
- }
- else {
- fprintf(file, "thread %p\n", (void*) threads_table.table[i].thread);
- }
- }
-
- fprintf(file, "======== END OF THREADS TABLE ========\n");
-
- pthread_mutex_unlock(&threadlistlock);
-}
-#endif
-
-
-#if defined(ENABLE_JVMTI)
-/* jvmti_get_threads_breakpoints ***********************************************
-
- gets all breakpoints from this file
-
-*******************************************************************************/
-
-void jvmti_get_threads_breakpoints(void **brks) {
- __asm__ ("movl $threadstart,%0;" :"=m"(brks[0]));
- __asm__ ("movl $threadend,%0;" :"=m"(brks[1]));
-}
-#endif
-