This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

spin() and Win32 port


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]