OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.jvmti/] [natgetallthreads.cc] - Blame information for rev 776

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
#include <gcj/cni.h>
2
 
3
#include <jvm.h>
4
#include <jvmti.h>
5
#include <stdio.h>
6
 
7
#include "jvmti-int.h"
8
#include "getallthreads.h"
9
 
10
void
11
getallthreads::natPlaceholder ()
12
{
13
         ex_frames--;
14
 
15
         if (ex_frames > 0)
16
           {
17
                         if ((getallthreads::thread_num % 2) == 0)
18
                           placeholder ();
19
                         else
20
                                 natPlaceholder ();
21
                 }
22
         else
23
           natRunner ();
24
}
25
 
26
void
27
getallthreads::natRunner ()
28
{
29
         done = true;
30
         while (done)
31
    yield ();
32
}
33
 
34
void
35
getallthreads::do_getallthreads_tests ()
36
{
37
  jvmtiEnv *env;
38
  JavaVM *vm = _Jv_GetJavaVM ();
39
  vm->GetEnv (reinterpret_cast<void **> (&env), JVMTI_VERSION_1_0);
40
 
41
         jint num_threads;
42
         jthread *thread_arr;
43
 
44
         jvmtiError jerr = env->GetAllThreads (&num_threads, &thread_arr);
45
         if (jerr != JVMTI_ERROR_NONE)
46
           {
47
                   printf ("Test Failed, JVMTI Error!\n");
48
                         return;
49
                 }
50
         env->Deallocate (reinterpret_cast<unsigned char *> (thread_arr));
51
 
52
         for (int i = 0; i < num_threads; i++)
53
         printf ("Found thread %d\n", i+1 );
54
}
55
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.