gjavah and volatility

Andrew Haley aph@redhat.com
Fri Jan 26 19:56:00 GMT 2007


Tom Tromey writes:
 > >>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
 > 
 > Andrew> This in Java:
 > Andrew> static volatile SecurityManager current;
 > Andrew> generates this in CNI:
 > Andrew> static volatile ::java::lang::SecurityManager * current;
 > Andrew> but of course the object isn't volatile, the field is. It should be
 > Andrew> static ::java::lang::SecurityManager * volatile current;
 > Andrew> shouldn't it?
 > 
 > Yeah, oops. But do we even want to translate java volatile into c++
 > volatile?
Very much, yes. 
I realize the Java volatile is stronger than the C++ volatile, and
therefore in theory we need locked accesses, but volatile is better
than nothing. (I note with some sadness that if we'd decided to
provide accessor methods for all BC-ABI accesses to fields then this
would "just work" because from CNI code we'd call the accessor. Ho
hum.)
Andrew.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /