[75] in java-interest

home help back first fref pref prev next nref lref last post

problem with synchronize( )

daemon@ATHENA.MIT.EDU (Suresh K Jois)
Tue May 9 21:41:45 1995

Date: Tue, 9 May 95 16:18:34 -0800
To: java-interest@java.Eng.Sun.COM
From: suresh@internet.net (Suresh K Jois)

Hi,

In the following, the first synchronize() statement  completely confuses
javac, while the second one works. Why is this ? To work around this
problem, I'm having to use an elaborate set of  lock()s and unlock()s. Also
it would be nice if synchronize() accepted multiple objects/classes for
locking in a single call:

int i;
int j[] = new int[5];
.....
synchronize(i)
{ i = 3;
  ......
}
......
synchronize(j)
{ j[1] = 3;
  .....
}
-----------------------------------------------------------------
Suresh K Jois. CyberSpace Gypsy. Virtual Spaces Architect.
Email: suresh@internet.net (Work)  sujo@netcom.com (Home)
WWW:http://www.internet.net
Traceroute: ->Informix->SiliconGraphics->Sun Microsystems
            ->Home Shopping Channel Inc/Internet Shopping Network
-----------------------------------------------------------------

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post