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
This commit is contained in:
Keith Seitz 2006-09-01 17:58:22 +00:00 committed by Keith Seitz
parent e6789bef7a
commit a56913dd37
2 changed files with 42 additions and 10 deletions

View File

@ -1,3 +1,11 @@
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.

View File

@ -56,25 +56,49 @@ static java::lang::Object *_envListLock = NULL;
// Some commonly-used checks
#define THREAD_DEFAULT_TO_CURRENT(jthread) \
if (jthread == NULL) jthread = java::lang::Thread::currentThread ();
#define THREAD_DEFAULT_TO_CURRENT(jthread) \
do \
{ \
if (jthread == NULL) \
jthread = java::lang::Thread::currentThread (); \
} \
while (0)
#define THREAD_CHECK_VALID(jthread) \
if (!java::lang::Thread::class$.isAssignableFrom (&(jthread->class$))) \
return JVMTI_ERROR_INVALID_THREAD;
do \
{ \
if (!java::lang::Thread::class$.isAssignableFrom (&(jthread->class$))) \
return JVMTI_ERROR_INVALID_THREAD; \
} \
while (0)
#define THREAD_CHECK_IS_ALIVE(thread) \
if (!thread->isAlive ()) return JVMTI_ERROR_THREAD_NOT_ALIVE;
#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,
// return JVMTI_ERROR_WRONG_PHASE
#define REQUIRE_PHASE(Env, Phases)
#define NULL_CHECK(Ptr) \
if (Ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
#define NULL_CHECK(Ptr) \
do \
{ \
if (Ptr == NULL) \
return JVMTI_ERROR_NULL_POINTER; \
} \
while (0)
#define ILLEGAL_ARGUMENT(Cond) \
if ((Cond)) return JVMTI_ERROR_ILLEGAL_ARGUMENT
#define ILLEGAL_ARGUMENT(Cond) \
do \
{ \
if ((Cond)) \
return JVMTI_ERROR_ILLEGAL_ARGUMENT; \
} \
while (0)
static jvmtiError JNICALL
_Jv_JVMTI_SuspendThread (MAYBE_UNUSED jvmtiEnv *env, jthread thread)