This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch [ecj]: Central Parking
Mohan Embar writes:
> This does away with _Jv_ThreadPark and _Jv_ThreadUnpark and keeps
> park() and unpark() in natUnsafe.cc, thereby allowing a shared
> implementation using the cross-platform synchronization functions
> and objects in posix-threads.h and win32-threads.h. Since the
> park() implementation uses _Jv_CondNotify, we also get thread
> interrupt support for free and can do away with the
> _Jv_ThreadUnpark call in Thread.interrupt().
Surely it's possible to avoid this: the POSIX version doesn't need to
call _Jv_CondWait and _Jv_CondNotify, and I don't see why the Win
version should either. But I guess I don't really mind what the Win
version does, as long as it passes the tests.
It would be nice if we had Win versions of pthread_cond_* with no
additional side-effects, and we could use those.
> I hope I did this right and understood everything correctly.
>
> I built this on a native i686-pc-linux-gnu compiler as
> well as a (i686-pc-linux-gnu,i686-pc-mingw32) cross, but didn't
> see any tests in the libjava testsuite for this, so it's
> untested. I figure that since it compiled without any
> errors, it must work flawlessly, but it would be nice to
> have a second set of eyes here.
I used the TCK at
http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/test/tck/.
Andrew.