Commit a56913dd by Keith Seitz Committed by Keith Seitz

jvmti.cc (THREAD_DEFAULT_TO_CURRENT): Encapsulate in do..while loop.

        * jvmti.cc (THREAD_DEFAULT_TO_CURRENT): Encapsulate in do..while loop.
        (THREAD_CHECK_VALID): Likewise.
        (THREAD_CHECK_IS_ALIVE): Likewise.
        (NULL_CHECK): Likewise.
        (ILLEGAL_ARGUMENT): Likewise.

From-SVN: r116636
parent e6789bef
2006-09-01 Keith Seitz <keiths@redhat.com> 2006-09-01 Keith Seitz <keiths@redhat.com>
* jvmti.cc (THREAD_DEFAULT_TO_CURRENT): Encapsulate in do..while loop.
(THREAD_CHECK_VALID): Likewise.
(THREAD_CHECK_IS_ALIVE): Likewise.
(NULL_CHECK): Likewise.
(ILLEGAL_ARGUMENT): Likewise.
2006-09-01 Keith Seitz <keiths@redhat.com>
* include/jvm.h (_Jv_JVMTI_Init): Declare. * include/jvm.h (_Jv_JVMTI_Init): Declare.
* jvmti.cc (_Jv_JVMTI_Init): New function. * jvmti.cc (_Jv_JVMTI_Init): New function.
* prims.cc (_Jv_CreateJavaVM): Initialize JVMTI. * prims.cc (_Jv_CreateJavaVM): Initialize JVMTI.
......
...@@ -56,25 +56,49 @@ static java::lang::Object *_envListLock = NULL; ...@@ -56,25 +56,49 @@ static java::lang::Object *_envListLock = NULL;
// Some commonly-used checks // Some commonly-used checks
#define THREAD_DEFAULT_TO_CURRENT(jthread) \ #define THREAD_DEFAULT_TO_CURRENT(jthread) \
if (jthread == NULL) jthread = java::lang::Thread::currentThread (); do \
{ \
if (jthread == NULL) \
jthread = java::lang::Thread::currentThread (); \
} \
while (0)
#define THREAD_CHECK_VALID(jthread) \ #define THREAD_CHECK_VALID(jthread) \
if (!java::lang::Thread::class$.isAssignableFrom (&(jthread->class$))) \ do \
return JVMTI_ERROR_INVALID_THREAD; { \
if (!java::lang::Thread::class$.isAssignableFrom (&(jthread->class$))) \
#define THREAD_CHECK_IS_ALIVE(thread) \ return JVMTI_ERROR_INVALID_THREAD; \
if (!thread->isAlive ()) return JVMTI_ERROR_THREAD_NOT_ALIVE; } \
while (0)
#define THREAD_CHECK_IS_ALIVE(thread) \
do \
{ \
if (!thread->isAlive ()) \
return JVMTI_ERROR_THREAD_NOT_ALIVE; \
} \
while (0)
// FIXME: if current phase is not set in Phases, // FIXME: if current phase is not set in Phases,
// return JVMTI_ERROR_WRONG_PHASE // return JVMTI_ERROR_WRONG_PHASE
#define REQUIRE_PHASE(Env, Phases) #define REQUIRE_PHASE(Env, Phases)
#define NULL_CHECK(Ptr) \ #define NULL_CHECK(Ptr) \
if (Ptr == NULL) return JVMTI_ERROR_NULL_POINTER; do \
{ \
#define ILLEGAL_ARGUMENT(Cond) \ if (Ptr == NULL) \
if ((Cond)) return JVMTI_ERROR_ILLEGAL_ARGUMENT return JVMTI_ERROR_NULL_POINTER; \
} \
while (0)
#define ILLEGAL_ARGUMENT(Cond) \
do \
{ \
if ((Cond)) \
return JVMTI_ERROR_ILLEGAL_ARGUMENT; \
} \
while (0)
static jvmtiError JNICALL static jvmtiError JNICALL
_Jv_JVMTI_SuspendThread (MAYBE_UNUSED jvmtiEnv *env, jthread thread) _Jv_JVMTI_SuspendThread (MAYBE_UNUSED jvmtiEnv *env, jthread thread)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment