Commit fd0e15b
committed
Make std::sync::Arc compatible with ThreadSanitizer
The memory fences used previously in Arc implementation are not properly
understood by ThreadSanitizer as synchronization primitives. This had
unfortunate effect where running any non-trivial program compiled with
`-Z sanitizer=thread` would result in numerous false positives.
Replace acquire fences with acquire loads when using ThreadSanitizer to
address the issue.1 parent f4c675c commit fd0e15b
2 files changed
+22
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
43 | 60 | | |
44 | 61 | | |
45 | 62 | | |
| |||
402 | 419 | | |
403 | 420 | | |
404 | 421 | | |
405 | | - | |
| 422 | + | |
406 | 423 | | |
407 | 424 | | |
408 | 425 | | |
| |||
739 | 756 | | |
740 | 757 | | |
741 | 758 | | |
742 | | - | |
| 759 | + | |
743 | 760 | | |
744 | 761 | | |
745 | 762 | | |
| |||
1243 | 1260 | | |
1244 | 1261 | | |
1245 | 1262 | | |
1246 | | - | |
| 1263 | + | |
1247 | 1264 | | |
1248 | 1265 | | |
1249 | 1266 | | |
| |||
1701 | 1718 | | |
1702 | 1719 | | |
1703 | 1720 | | |
1704 | | - | |
| 1721 | + | |
1705 | 1722 | | |
1706 | 1723 | | |
1707 | 1724 | | |
| |||
0 commit comments