Repository navigation
Commit 9985263
committed
Support synchronous executors
BackgroundExecutor assumed that its executor was asynchronous, so that
in execute(Task), a task could not be removed before it has been added
to the TASKS list.
However, this assumption was wrong with a synchronous executor:
directExecute(…) would execute the task synchronously, leading to call
Task#postExecute(), that removes the task from TASKS. Immediately after
the execution, directExecute(…) would add the task to TASKS, which let
the BackgroundExecutor in an incorrect state.
Therefore, add the task to the TASKS list before the execution, so that
it will also work with synchronous executors.
Fixes androidannotations#1689.
<androidannotations#1689>1 parent a003c49 commit 9985263
2 files changed
Lines changed: 30 additions & 11 deletions
File tree
- AndroidAnnotations/androidannotations-core
- androidannotations-api/src/main/java/org/androidannotations/api
- androidannotations-test/src/test/java/org/androidannotations/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | 131 | | |
137 | 132 | | |
138 | | - | |
139 | 133 | | |
140 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
166 | 191 | | |
167 | 192 | | |
168 | 193 | | |
| |||
173 | 198 | | |
174 | 199 | | |
175 | 200 | | |
176 | | - | |
177 | | - | |
| 201 | + | |
178 | 202 | | |
179 | 203 | | |
180 | 204 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | 205 | | |
185 | 206 | | |
186 | 207 | | |
| |||
0 commit comments