Skip to content

Commit c4f449b

Browse files
committed
switch C++ default to LuvScheduler + ThreadPoolDispatcher
too many random failures, let's see if it's better like this
1 parent dc9a01b commit c4f449b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/hxcoro/run/Setup.hx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ class Setup {
7878
);
7979
}
8080

81+
static public function createLuvThreadPool() {
82+
final pool = new hxcoro.thread.FixedThreadPool(10);
83+
return createLuvGen(
84+
(uvLoop, loop) -> new hxcoro.dispatchers.LuvDispatcher(uvLoop, loop),
85+
dispatcher -> pool.shutDown()
86+
);
87+
}
88+
8189
#elseif interp
8290

8391
static public function createLuv() {
@@ -111,8 +119,10 @@ class Setup {
111119
#end
112120

113121
static public function createDefault() {
114-
#if (cpp && hxcpp_luv_io || interp)
122+
#if interp
115123
return createLuv();
124+
#elseif (cpp && hxcpp_luv_io)
125+
return createLuvThreadPool();
116126
#elseif (jvm || cpp || hl)
117127
return createThreadPool(10);
118128
#else

0 commit comments

Comments
 (0)