java - Custom CyclicBarrier implementaion -


greeting stackoverflow,,, i'm trying implement own cyclicbarrier , came with, have idea what's problem.

    public class mybarrier {     int arrived = 0;     final int threads;     public synchronized void sync(thread thread) throws interruptedexception {         arrived++;         if (arrived == threads) {             arrived = 0;             notifyall();         } else {             while (arrived > 0) {                 wait();              }         }     } } 


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -