This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
spin() and Win32 port
- From: Tom Tromey <tromey at redhat dot com>
- To: gcj mail list <java at gcc dot gnu dot org>
- Date: 18 Dec 2002 15:22:56 -0700
- Subject: spin() and Win32 port
- Reply-to: tromey at redhat dot com
I let in a small change to natObject.cc that changed spin() to call
Thread::sleep instead of usleep().
I think this was a mistake (to be honest I don't recall seeing that
code in a patch, double oops on me). spin() is used in the
implementation of _Jv_MonitorEnter; the point as I understand it is to
sleep a bit to avoid creating a heavyweight mutex. However,
Thread::sleep() acquires just such a mutex -- defeating the purpose of
spin().
I'm planning to revert this patch, but I wanted to give the Win32
developers a heads-up. I assume this went in in the first place due
to some problem with usleep on Win32. Adam, Ranjit -- does this need
a new platform function for Win32?
Tom