forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8c3debb
committed
Fix and improve pg_atomic_flag fallback implementation.
The atomics fallback implementation for pg_atomic_flag was broken,returning the inverted value from pg_atomic_test_set_flag(). This wasunnoticed because a) atomic flags were unused until recently b) thetest code wasn't run when the fallback implementation was inuse (because it didn't allow to test for some edge cases).Fix the bug, and improve the fallback so it has the same behaviour asthe non-fallback implementation in the problematic edge cases. Thatbreaks ABI compatibility in the back branches when fallbacks are inuse, but given they were broken until now...Author: Andres FreundReported-by: Daniel GustafssonDiscussion:https://postgr.es/m/FB948276-7B32-4B77-83E6-D00167F8EEB4@yesql.sehttps://postgr.es/m/20180406233854.uni2h3mbnveczl32@alap3.anarazel.deBackpatch: 9.5-, where the atomics abstraction was introduced.1 parenteb2a0e0 commit8c3debb
File tree
3 files changed
+21
-27
lines changed- src
- backend/port
- include/port/atomics
- test/regress
3 files changed
+21
-27
lines changedLines changed: 19 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
| 71 | + | |
| 72 | + | |
71 | 73 |
| |
72 | 74 |
| |
73 | 75 |
| |
74 | 76 |
| |
75 | 77 |
| |
76 |
| - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
77 | 86 |
| |
78 | 87 |
| |
79 | 88 |
| |
80 | 89 |
| |
81 | 90 |
| |
82 |
| - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
83 | 100 |
| |
84 | 101 |
| |
85 | 102 |
| |
|
Lines changed: 2 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
| 83 | + | |
83 | 84 |
| |
84 | 85 |
| |
85 | 86 |
| |
| |||
132 | 133 |
| |
133 | 134 |
| |
134 | 135 |
| |
135 |
| - | |
136 |
| - | |
137 |
| - | |
138 |
| - | |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
| 136 | + | |
146 | 137 |
| |
147 | 138 |
| |
148 | 139 |
| |
|
Lines changed: 0 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
633 | 633 |
| |
634 | 634 |
| |
635 | 635 |
| |
636 |
| - | |
637 | 636 |
| |
638 | 637 |
| |
639 | 638 |
| |
| |||
663 | 662 |
| |
664 | 663 |
| |
665 | 664 |
| |
666 |
| - | |
667 | 665 |
| |
668 | 666 |
| |
669 | 667 |
| |
| |||
846 | 844 |
| |
847 | 845 |
| |
848 | 846 |
| |
849 |
| - | |
850 |
| - | |
851 |
| - | |
852 |
| - | |
853 |
| - | |
854 |
| - | |
855 |
| - | |
856 |
| - | |
857 |
| - | |
858 |
| - | |
859 |
| - | |
860 | 847 |
| |
861 |
| - | |
862 | 848 |
| |
863 | 849 |
| |
864 | 850 |
| |
|
0 commit comments
Comments
(0)