You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Weldon Washburn <we...@gmail.com> on 2006/11/10 23:36:00 UTC

[drlvm][threading module] a question about jthread_raw_monitor_create()

I might be misunderstanding the code but the local variable,
"hythread_monitor_t monitor;" is used as a parameter to a call to
array_add(jvmti_monitor_table, monitor);.  It seems that once
jthread_raw_monitor_create() returns, the jvmti_monitor_table will end up
with an invalid pointer.  Is this correct?

-- 
Weldon Washburn
Intel Enterprise Solutions Software Division

Re: [drlvm][threading module] a question about jthread_raw_monitor_create()

Posted by Gregory Shimansky <gs...@gmail.com>.
On Saturday 11 November 2006 01:36 Weldon Washburn wrote:
> I might be misunderstanding the code but the local variable,
> "hythread_monitor_t monitor;" is used as a parameter to a call to
> array_add(jvmti_monitor_table, monitor);.  It seems that once
> jthread_raw_monitor_create() returns, the jvmti_monitor_table will end up
> with an invalid pointer.  Is this correct?

It looks more like monitor value which is initialized in hythread_monitor_init 
is passed to array_add and there it is remembered. It is not a problem that 
monitor is a local variable since hythread_monitor_init provides a pointer to 
a data allocated somewhere not on the stack.

-- 
Gregory Shimansky, Intel Middleware Products Division