This API was added to java 1.5
Confirmed, even classpath does not have this yet.
This is a classpath issue but for some reason I cannot move it.
Moving to classpath.
FYI, the JSR 166 Concurrency Utilities sources <http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/> are in the public domain.
This is not really public domain:
This code is covered by the nearly-but-not-exactly-free nuclear-bsd license.
whoops sorry, I missed the first couple of lines, which hopefully means that most of the code is indeed public domain:
The software comprising JSR166 was written by Doug Lea with assistance
from members of JCP JSR-166 Expert roup and released to the public
domain, as explained at:
http://creativecommons.org/licenses/publicdomain, excepting portions
of the class java.util.concurrent.CopyOnWriteArrayList, which were
adapted from class java.util.ArrayList, written by Sun Microsystems,
Inc, which are used with kind permission, and subject to the
Yes, we can use most of these sources, just not all of them.
I have a patch here which does it. And we already have
stubbed declarations for most of the needed VM support.
To finish we need:
1. A script which takes the jsr166 source and strips out
everything copyright Sun (last time I did this by hand,
but we want to automate for future imports).
2. A script to change com.sun.Unsafe (or whatever it was called)
to gnu.classpath.Unsafe (a trivial sed would do).
3. We have to figure out how to handle some reflection permissions
calls in the concurrency code. Nobody has really looked at this
yet; in my tree I have them commented out just to make it all compile.
At this point we could import, but it wouldn't work.
For it to work, VMs must implement the Unsafe API.
I can send my patch to anybody who wants it.
Perhaps I ought to upload it here... ?
Checked in on the generics branch.
Note that the VM requires changes for this code to work.