harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Shimansky <gshiman...@gmail.com>
Subject Re: [drlvm][threading module] a question about jthread_raw_monitor_create()
Date Fri, 10 Nov 2006 22:47:54 GMT
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

Mime
View raw message