harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib][compatibility]sun.misc.Unsafe.unpark(Thread) or unpark(Object)?
Date Tue, 24 Apr 2007 12:06:53 GMT
Angela Lin wrote:
> In the IBM VM, we assume that Unsafe.unpark() is always passed a
> Thread. The incoming object is not type-checked. This assumption was
> valid in the past and was probably made for performance reasons.
> It would be safer (from my point of view, at least) to leave the
> signature as unpark(Thread). I don't think this would cause binary
> incompatibility, since the native declaration would be unpark(jobject)
> in any case.

The concern is for Java class file binary compatibility.  If people
compile their Java code against our version of unpark(Thread) then it
will not run on the RI version, defined as unpark(Object).  They will
get a NoSuchMethodError.

> If j.u.concurrent is passing non-Thread objects to unpark(), this
> would be a much more significant problem for us.

For sure.

In my simple test of passing in a String...
 IBM 5.0SR2 -> segmentation error
 Sun 1.6b65 -> does nothing


View raw message