Re: [Sablevm-developer] acquiring monitor
Brought to you by:
egagnon
From: Archie C. <ar...@de...> - 2003-02-10 05:15:09
|
David Paul BELANGER wrote: > > In the case of Class.getMethod() (and therefore Class.nativeGetMethod()) > > the spec says that accessing the Method object associated with a > > class is an "active use" and so the class must be linked if it hasn't > > already been linked. And linking the class's type of course requires > > acquiring the monitor. > > Yes, I do understand that part but the link functions do acquire it. > I am wondering why we have this structure: > > acquire monitor > . > . > . > link_class() > (inside link_class) > acquire monitor > . > . > . > release monitor > . > initialize_class > acquire monitor > . > . > release monitor > . > . > release monitor > > What functions are we protecting with the external acquire monitor? Maybe it's for the creation of the new Method reflection instance? The JVM must ensure that it only gets created once. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com |