Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class bn
- implements Runnable
- {
- private bn()
- {
- b = new Object();
- c = Collections.synchronizedSet(new HashSet());
- d = Collections.synchronizedList(new ArrayList());
- e = true;
- Thread thread = new Thread(this, "File IO Thread");
- thread.setPriority(5);
- thread.start();
- }
- public void run()
- {
- do
- b();
- while(true);
- }
- private void b()
- {
- for(int i = 0; i < d.size(); i++)
- {
- dv dv1 = (dv)d.get(i);
- if(!dv1.v_())
- synchronized(b)
- {
- d.remove(dv1);
- c.remove(dv1);
- if(c.isEmpty())
- e = true;
- }
- try
- {
- Thread.sleep(5L);
- }
- catch(InterruptedException interruptedexception)
- {
- interruptedexception.printStackTrace();
- }
- }
- }
- public void a(dv dv1)
- {
- label0:
- {
- synchronized(b)
- {
- e = false;
- if(!c.contains(dv1))
- break label0;
- }
- return;
- }
- c.add(dv1);
- d.add(dv1);
- obj;
- JVM INSTR monitorexit ;
- }
- public void a()
- throws InterruptedException
- {
- while(!e)
- Thread.sleep(10L);
- }
- public static final bn a = new bn();
- private Object b;
- private Set c;
- private List d;
- private volatile boolean e;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement