This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Commit 7c50828
authored
Fix race condition in DiagnosticSourceEventSource (#35269)
* Use RemoteInvoke in DiagnosticSourceEventListener tests
Running these concurrently with other tests in the same process can result in spurious failures.
* Fix race condition in DiagnosticSourceEventSource
If multiple threads all try to write different objects at the same time, PropertySpec.Fetch can manifest a race condition that results in potentially trying to cast one call's object to another call's type. The fix is to allow for atomically storing the cached data, and using a local to ensure that a calling thread's view is consistent.1 parent 5726c1e commit 7c50828
File tree
3 files changed
+584
-506
lines changed- src/System.Diagnostics.DiagnosticSource
- src/System/Diagnostics
- tests
3 files changed
+584
-506
lines changedLines changed: 20 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
803 | | - | |
| 803 | + | |
| 804 | + | |
804 | 805 | | |
805 | | - | |
806 | | - | |
807 | | - | |
| 806 | + | |
| 807 | + | |
808 | 808 | | |
809 | | - | |
| 809 | + | |
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
| |||
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
823 | | - | |
| 823 | + | |
824 | 824 | | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
825 | 833 | | |
826 | 834 | | |
827 | 835 | | |
828 | 836 | | |
829 | | - | |
| 837 | + | |
830 | 838 | | |
831 | 839 | | |
832 | | - | |
| 840 | + | |
833 | 841 | | |
834 | 842 | | |
835 | 843 | | |
836 | 844 | | |
837 | | - | |
| 845 | + | |
838 | 846 | | |
839 | 847 | | |
840 | 848 | | |
| |||
844 | 852 | | |
845 | 853 | | |
846 | 854 | | |
847 | | - | |
| 855 | + | |
848 | 856 | | |
849 | | - | |
| 857 | + | |
850 | 858 | | |
851 | 859 | | |
852 | 860 | | |
| |||
860 | 868 | | |
861 | 869 | | |
862 | 870 | | |
863 | | - | |
864 | | - | |
| 871 | + | |
865 | 872 | | |
866 | 873 | | |
867 | 874 | | |
| |||
0 commit comments