This is the mail archive of the java-prs@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]

libgcj/8997: spin() calls Thread.sleep


>Number:         8997
>Category:       libgcj
>Synopsis:       spin() calls Thread.sleep
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 18 14:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Tom Tromey
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
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().

(See java list for more info.)
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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