forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit15ad6f1
committed
When building with LWLOCK_STATS, initialize the stats in LWLockWaitUntilFree.
If LWLockWaitUntilFree was called before the first LWLockAcquire call, youwould either crash because of access to uninitialized array or account theacquisition incorrectly. LWLockConditionalAcquire doesn't have this problembecause it doesn't update the lwlock stats.In practice, this never happens because there is no codepath where you wouldcall LWLockWaitUntilfree before LWLockAcquire after a new process islaunched. But that's just accidental, there's no guarantee that that'salways going to be true in the future.Spotted by Jeff Janes.1 parent442231d commit15ad6f1
1 file changed
+23
-10
lines changedLines changed: 23 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
123 | 123 |
| |
124 | 124 |
| |
125 | 125 |
| |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
126 | 142 |
| |
127 | 143 |
| |
128 | 144 |
| |
| |||
332 | 348 |
| |
333 | 349 |
| |
334 | 350 |
| |
335 |
| - | |
336 |
| - | |
337 |
| - | |
338 |
| - | |
339 |
| - | |
340 |
| - | |
341 |
| - | |
342 |
| - | |
343 |
| - | |
344 |
| - | |
| 351 | + | |
345 | 352 |
| |
346 | 353 |
| |
347 | 354 |
| |
| |||
588 | 595 |
| |
589 | 596 |
| |
590 | 597 |
| |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
591 | 604 |
| |
592 | 605 |
| |
593 | 606 |
| |
|
0 commit comments
Comments
(0)