📄 asyncdispatcher.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: AsyncDispatcher.java
package org.gudy.azureus2.core3.util;
import java.util.LinkedList;
// Referenced classes of package org.gudy.azureus2.core3.util:
// AESemaphore, AEThread2, AERunnable, Debug
public class AsyncDispatcher
{
private AEThread2 thread;
private LinkedList queue;
private AESemaphore queue_sem;
private int quiesce_after_millis;
public AsyncDispatcher()
{
this(10000);
}
public AsyncDispatcher(int _quiesce_after_millis)
{
queue = new LinkedList();
queue_sem = new AESemaphore("AsyncDispatcher");
quiesce_after_millis = _quiesce_after_millis;
}
public void dispatch(AERunnable target)
{
synchronized (this)
{
queue.add(target);
if (thread == null)
{
thread = new AEThread2("AsyncDispatcher", true) {
final AsyncDispatcher this$0;
public void run()
{
_L3:
AERunnable to_run;
label0:
{
queue_sem.reserve(quiesce_after_millis);
to_run = null;
synchronized (AsyncDispatcher.this)
{
if (!queue.isEmpty())
break label0;
thread = null;
}
break; /* Loop/switch isn't completed */
}
to_run = (AERunnable)queue.removeFirst();
asyncdispatcher1;
JVM INSTR monitorexit ;
goto _L1
exception1;
throw exception1;
_L1:
try
{
to_run.runSupport();
}
catch (Throwable e)
{
Debug.printStackTrace(e);
}
if (true) goto _L3; else goto _L2
_L2:
}
{
this$0 = AsyncDispatcher.this;
super(x0, x1);
}
};
thread.start();
}
}
queue_sem.release();
}
public int getQueueSize()
{
AsyncDispatcher asyncdispatcher = this;
JVM INSTR monitorenter ;
return queue.size();
Exception exception;
exception;
throw exception;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -