Commit 0043aba
fix(shutdown): Prevent race condition when GlobalObject destruction routine unlocks global mutex (#8652)
* fix(shutdown): Prevent race condition when ~GlobalObjectHolder() routine unlocks global mutex
Unlocking global mutex in GlobalObject destruction routine made it possible for a new attachment to slip in, so it will be creating new GlobalObject and using it, while destroying routine still in action. This can lead to an undefined state of the global objects, such as shared memory, where one thread is actively using it while another thread is destroying it.
* fix(shutdown): Reimplement synchronization between shutdown and init routine for GlobalObjectHolder
* refactor(shutdown): Remove unused variable
* refactor(shutdown): Code adjustments after Vlad review
---------
Co-authored-by: Artyom Ivanov <[email protected]>1 parent ed64eb6 commit 0043aba
2 files changed
+49
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
590 | 616 | | |
591 | 617 | | |
592 | 618 | | |
593 | | - | |
| 619 | + | |
594 | 620 | | |
| 621 | + | |
595 | 622 | | |
596 | 623 | | |
597 | 624 | | |
| |||
601 | 628 | | |
602 | 629 | | |
603 | 630 | | |
604 | | - | |
605 | | - | |
606 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
607 | 643 | | |
608 | 644 | | |
609 | 645 | | |
| |||
616 | 652 | | |
617 | 653 | | |
618 | 654 | | |
619 | | - | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
620 | 659 | | |
621 | 660 | | |
622 | 661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
| |||
0 commit comments