File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,7 @@ private class SynchronizedLinkedListImpl<T> implements OrderedCollection<T> {
325
325
var i = 0 ;
326
326
var foundAt = - 1 ;
327
327
for (item in _items ) {
328
+ #if (haxe_ver >= 4.3) @:nullSafety (Off ) #end
328
329
if (startAt != null && i > startAt )
329
330
break ;
330
331
if (item == x )
Original file line number Diff line number Diff line change @@ -120,14 +120,12 @@ class ThreadPoolExecutor extends Executor {
120
120
}
121
121
122
122
123
- public function submit <T >(task : Either2 <Void -> T ,Void -> Void >, ? schedule : Schedule ): TaskFuture <T >
123
+ public function submit <T >(task : Either2 <Void -> T ,Void -> Void >, ? schedule : Schedule ): TaskFuture <T > {
124
+ final schedule : Schedule = schedule == null ? Executor .NOW_ONCE : schedule ;
124
125
return _stateLock .execute (function () {
125
126
if (state != RUNNING )
126
127
throw ' Cannot accept new tasks. Executor is not in state [RUNNING] but [ $state ].' ;
127
128
128
- if (schedule == null )
129
- schedule = Executor .NOW_ONCE ;
130
-
131
129
final future = new TaskFutureImpl <T >(this , task , schedule );
132
130
133
131
// skip round-trip via scheduler for one-shot tasks that should be executed immediately
@@ -143,6 +141,7 @@ class ThreadPoolExecutor extends Executor {
143
141
_newScheduledTasks .push (future );
144
142
return future ;
145
143
});
144
+ }
146
145
147
146
148
147
override //
Original file line number Diff line number Diff line change 5
5
*/
6
6
package hx .concurrent .executor ;
7
7
8
- import hx .concurrent .Future .FutureResult ;
9
8
import hx .concurrent .executor .Executor .AbstractTaskFuture ;
10
9
import hx .concurrent .executor .Executor .Task ;
11
10
import hx .concurrent .executor .Executor .TaskFuture ;
@@ -30,7 +29,8 @@ class TimerExecutor extends Executor {
30
29
}
31
30
32
31
33
- public function submit <T >(task : Either2 <Void -> T , Void -> Void >, ? schedule : Schedule ): TaskFuture <T >
32
+ public function submit <T >(task : Either2 <Void -> T , Void -> Void >, ? schedule : Schedule ): TaskFuture <T > {
33
+ final schedule : Schedule = schedule == null ? Executor .NOW_ONCE : schedule ;
34
34
return _stateLock .execute (function () {
35
35
if (state != RUNNING )
36
36
throw ' Cannot accept new tasks. Executor is not in state [RUNNING] but [ $state ].' ;
@@ -40,14 +40,14 @@ class TimerExecutor extends Executor {
40
40
while (i -- > 0 )
41
41
if (_scheduledTasks [i ].isStopped ) _scheduledTasks .splice (i , 1 );
42
42
43
- final future = new TaskFutureImpl <T >(this , task , schedule == null ? Executor . NOW_ONCE : schedule );
43
+ final future = new TaskFutureImpl <T >(this , task , schedule );
44
44
switch (schedule ) {
45
45
case ONCE (0 ):
46
46
default : _scheduledTasks .push (future );
47
47
}
48
48
return future ;
49
49
});
50
-
50
+ }
51
51
52
52
override //
53
53
function onStop () {
You can’t perform that action at this time.
0 commit comments