forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4efe26c
committed
shm_mq: Third attempt at fixing nowait behavior in shm_mq_receive.
Commita1480ec purported to fix theproblems with commitb2ccb5f, but itdidn't completely fix them. The problem is that the checks wereperformed in the wrong order, leading to a race condition. If thesender attached, sent a message, and detached after the receivercalled shm_mq_get_sender and before the receiver calledshm_mq_counterparty_gone, we'd incorrectly return SHM_MQ_DETACHEDbefore all messages were read. Repair by reversing the order ofoperations, and add a long comment explaining why this new logic is(hopefully) correct.1 parent0279f62 commit4efe26c
1 file changed
+17
-2
lines changedLines changed: 17 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
501 | 501 |
| |
502 | 502 |
| |
503 | 503 |
| |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
504 | 518 |
| |
505 | 519 |
| |
506 |
| - | |
| 520 | + | |
507 | 521 |
| |
508 |
| - | |
| 522 | + | |
| 523 | + | |
509 | 524 |
| |
510 | 525 |
| |
511 | 526 |
| |
|
0 commit comments
Comments
(0)