JvSynchronize nitpick

Alexandre Oliva aoliva@cygnus.com
Tue Mar 28 17:34:00 GMT 2000

How about:

class JvSynchronizeHelper
  JvSynchronize sync;
  JvSynchronizeHelper (const jobject &obj) : sync (obj) {}
  operator bool () const { return false; }

#define synchronized(OBJECT) \
  if (const JvSynchronizeHelper& __JvX = JvSynchronizeHelper((OBJECT))) \
    ; \

Or, even better: can't JvSynchronize have an implicit converter to
bool false?

Alexandre Oliva    Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

More information about the Java mailing list