@@ -0,0 +1,1606 @@
+/**%0A%0A * The Computer Language Benchmarks Game%0A%0A * http://benchmarksgame.alioth.debian.org/%0A%0A * contributed by Klaus Friedel%0A%0A * modified by Daryl Griffith%0A%0A */%0A%0Aimport java.util.concurrent.locks.LockSupport;%0A%0Apublic class threadring extends Thread %7B%0A%0A    static final int THREAD_COUNT = 503;%0A%0A    threadring nextThread;%0A    volatile boolean waiting = true;%0A    int message;%0A%0A    public threadring(int name) %7B%0A        super(Integer.toString(name));%0A    %7D%0A%0A    @Override%0A    public void run() %7B%0A        for (;;) %7B%0A            while (waiting) %7B%0A                LockSupport.park();%0A            %7D%0A            if (message == 0) %7B%0A                System.out.println(getName());%0A                System.exit(0);%0A            %7D%0A            waiting = true;%0A            nextThread.message = message - 1;%0A            nextThread.waiting = false;%0A            LockSupport.unpark(nextThread);%0A        %7D%0A    %7D%0A%0A    public static void main(String args%5B%5D) throws Exception %7B%0A        threadring first = new threadring(1);%0A        threadring current = new threadring(2);%0A%0A        first.start(); // Thread 1%0A%0A        first.nextThread = current;%0A        first.message = Integer.parseInt(args%5B0%5D);%0A        first.waiting = false;%0A        for (int i = 3; i %3C THREAD_COUNT; i++) %7B%0A            current.nextThread = new threadring(i);%0A            current.start();%0A            current = current.nextThread;%0A        %7D%0A        current.nextThread = new threadring(THREAD_COUNT);%0A        current.start(); // Thread 502%0A%0A        current = current.nextThread;%0A        current.nextThread = first;%0A        current.start(); // Thread 503%0A%0A    %7D%0A%7D%0A

add java #7 implementation