You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
441 B
Java
19 lines
441 B
Java
8 months ago
|
package net.ossrs.yasea;
|
||
|
|
||
|
import java.util.LinkedList;
|
||
|
|
||
|
public class PendingThreadAider {
|
||
|
LinkedList<Runnable> mRunOnDraw = new LinkedList<Runnable>();
|
||
|
|
||
|
public void runPendings() {
|
||
|
while (!mRunOnDraw.isEmpty()) {
|
||
|
mRunOnDraw.removeFirst().run();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void addToPending(final Runnable runnable) {
|
||
|
synchronized (mRunOnDraw) {
|
||
|
mRunOnDraw.addLast(runnable);
|
||
|
}
|
||
|
}
|
||
|
}
|