Skip to content

Commit 2d5b4f0

Browse files
committed
ApplicationManager
1 parent 7eed303 commit 2d5b4f0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.intellij.openapi.application;
2+
3+
import java.util.concurrent.LinkedBlockingQueue;
4+
import java.util.concurrent.ThreadPoolExecutor;
5+
import java.util.concurrent.TimeUnit;
6+
7+
public class ApplicationManager {
8+
private static ApplicationManager instance;
9+
10+
public static ApplicationManager getInstance() {
11+
if (instance == null) {
12+
instance = new ApplicationManager();
13+
}
14+
return instance;
15+
}
16+
17+
private final ThreadPoolExecutor executor;
18+
19+
public ApplicationManager() {
20+
executor = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
21+
}
22+
23+
public void executeOnPooledThread(Runnable runnable) {
24+
executor.execute(runnable);
25+
}
26+
}

0 commit comments

Comments
 (0)