libgcj/8997: spin() calls Thread.sleep

tromey@redhat.com tromey@redhat.com
Wed Dec 18 14:26:00 GMT 2002


>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:



More information about the Gcc-prs mailing list