Commit 0fa13ee
authored
Fix race condition with garbage collection (#9465)
This change fixes an intermittent crash caused by a thread race
condition.
The crash happened when a CallbackHandler::Callback (triggered by
engine.flush()) attempted to create an instance of a Structure of Arrays
(SoA) like TransformManager, which adds items to SoA) at the same time
that the garbage collection job (FEngine::gc, which removes items from
SoA) was running.
This conflict is resolved by modifying the logic to ensure that the
garbage collection task completes synchronously before the callback
operations begin.1 parent 1d2b8a0 commit 0fa13ee
1 file changed
+6
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | 295 | | |
302 | 296 | | |
303 | | - | |
304 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
305 | 300 | | |
306 | 301 | | |
307 | 302 | | |
| |||
468 | 463 | | |
469 | 464 | | |
470 | 465 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | 466 | | |
478 | 467 | | |
479 | | - | |
480 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
481 | 471 | | |
482 | 472 | | |
483 | 473 | | |
| |||
0 commit comments