- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit038aa89
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 parent11e7f9d commit038aa89
1 file changed
+17
-2
lines changedLines changed: 17 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
405 | 405 |
| |
406 | 406 |
| |
407 | 407 |
| |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
408 | 422 |
| |
409 | 423 |
| |
410 |
| - | |
| 424 | + | |
411 | 425 |
| |
412 |
| - | |
| 426 | + | |
| 427 | + | |
413 | 428 |
| |
414 | 429 |
| |
415 | 430 |
| |
|
0 commit comments
Comments
(0)