Advertisement
iPeer

Untitled

Sep 23rd, 2011
1,743
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.67 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class bn
  4.     implements Runnable
  5. {
  6.  
  7.     private bn()
  8.     {
  9.         b = new Object();
  10.         c = Collections.synchronizedSet(new HashSet());
  11.         d = Collections.synchronizedList(new ArrayList());
  12.         e = true;
  13.         Thread thread = new Thread(this, "File IO Thread");
  14.     }
  15.  
  16.     public void run()
  17.     {
  18.         do
  19.             b();
  20.         while(true);
  21.     }
  22.  
  23.     private void b()
  24.     {
  25.         for(int i = 0; i < d.size(); i++)
  26.         {
  27.             dv dv1 = (dv)d.get(i);
  28.             if(dv1.v_())
  29.                 continue;
  30.             synchronized(b)
  31.             {
  32.                 d.remove(dv1);
  33.                 c.remove(dv1);
  34.                 if(c.isEmpty())
  35.                     e = true;
  36.             }
  37.         }
  38.  
  39.     }
  40.  
  41.     public void a(dv dv1)
  42.     {
  43.         Object obj = b;
  44.         JVM INSTR monitorenter ;
  45.         e = false;
  46.         if(!c.contains(dv1))
  47.             break MISSING_BLOCK_LABEL_41;
  48.         obj;
  49.         JVM INSTR monitorexit ;
  50.           goto _L1
  51.         Exception exception;
  52.         exception;
  53.         throw exception;
  54. _L1:
  55.         return;
  56.         c.add(dv1);
  57.         d.add(dv1);
  58.         return;
  59.     }
  60.  
  61.     public void a()
  62.         throws InterruptedException
  63.     {
  64.     //This thread creation probably isn't needed. It's just here to prevent errors!
  65.         Thread thread = new Thread(this, "File IO Thread");
  66.         thread.setPriority(5);
  67.         thread.start();
  68.         while(!e)
  69.             Thread.sleep(10L);
  70.         thread.stop();
  71.     }
  72.  
  73.     public static final bn a = new bn();
  74.     private Object b;
  75.     private Set c;
  76.     private List d;
  77.     private volatile boolean e;
  78.  
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement