Commit bec968c
committed
mp.input: send buffer ids with logs to avoid race conditions
This commit modifies the log methods in mp.input to always send the id
of the latest `input.get()` request with log entries.
Previously, the log methods applied to whichever input request happened
to be open when the log message was received. Even when scripts used
these methods correctly, there was the risk of sending a log to the
wrong log buffer if the active input request changed while the log
message was in transit; a race condition.
Now the id of the latest `input.get()` request is sent alongside the log
messages, preventing data races between scripts while also preventing
those logs from being discarded.1 parent debb26d commit bec968c
3 files changed
Lines changed: 51 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
| 658 | + | |
658 | 659 | | |
659 | 660 | | |
660 | 661 | | |
| |||
686 | 687 | | |
687 | 688 | | |
688 | 689 | | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
689 | 697 | | |
690 | 698 | | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
| 699 | + | |
| 700 | + | |
695 | 701 | | |
696 | 702 | | |
697 | 703 | | |
| |||
700 | 706 | | |
701 | 707 | | |
702 | 708 | | |
| 709 | + | |
703 | 710 | | |
704 | 711 | | |
705 | 712 | | |
706 | 713 | | |
707 | 714 | | |
708 | 715 | | |
709 | | - | |
710 | | - | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
711 | 721 | | |
712 | 722 | | |
| 723 | + | |
713 | 724 | | |
714 | | - | |
| 725 | + | |
715 | 726 | | |
716 | 727 | | |
717 | | - | |
| 728 | + | |
718 | 729 | | |
719 | 730 | | |
720 | 731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1740 | 1740 | | |
1741 | 1741 | | |
1742 | 1742 | | |
1743 | | - | |
1744 | 1743 | | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
1745 | 1751 | | |
1746 | 1752 | | |
1747 | 1753 | | |
| |||
1754 | 1760 | | |
1755 | 1761 | | |
1756 | 1762 | | |
1757 | | - | |
| 1763 | + | |
1758 | 1764 | | |
1759 | 1765 | | |
1760 | 1766 | | |
| |||
1770 | 1776 | | |
1771 | 1777 | | |
1772 | 1778 | | |
1773 | | - | |
| 1779 | + | |
| 1780 | + | |
1774 | 1781 | | |
1775 | | - | |
| 1782 | + | |
1776 | 1783 | | |
1777 | 1784 | | |
1778 | 1785 | | |
| |||
1789 | 1796 | | |
1790 | 1797 | | |
1791 | 1798 | | |
1792 | | - | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
1793 | 1802 | | |
1794 | 1803 | | |
1795 | 1804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
77 | 84 | | |
78 | 85 | | |
79 | 86 | | |
| |||
83 | 90 | | |
84 | 91 | | |
85 | 92 | | |
| 93 | + | |
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
93 | | - | |
94 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
95 | 106 | | |
96 | 107 | | |
97 | 108 | | |
98 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
0 commit comments