Skip to content

Commit 52093bb

Browse files
committed
Use newSingleThreadExecutor to avoid "unable to create new native
thread" issue.
1 parent f2ee505 commit 52093bb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/tinystruct/examples/talk.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
public class talk extends AbstractApplication {
2727

2828
private static final long TIMEOUT = 10;
29-
private static final int DEFAULT_POOL_SIZE = 3;
3029
protected static final int DEFAULT_MESSAGE_POOL_SIZE = 10;
3130
protected final Map<String, BlockingQueue<Builder>> meetings = new ConcurrentHashMap<String, BlockingQueue<Builder>>();
3231
protected final Map<String, Queue<Builder>> list = new ConcurrentHashMap<String, Queue<Builder>>();
@@ -115,7 +114,7 @@ public void run() {
115114
}
116115

117116
private ExecutorService getService() {
118-
return this.service!=null? this.service : Executors.newFixedThreadPool(DEFAULT_POOL_SIZE);
117+
return this.service!=null? this.service : Executors.newSingleThreadExecutor();
119118
}
120119

121120
/**

0 commit comments

Comments
 (0)