forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7bb0e97
committed
Extend shm_mq API with new functions shm_mq_sendv, shm_mq_set_handle.
shm_mq_sendv sends a message to the queue assembled from multiplelocations. This is expected to be used by forthcoming patches toallow frontend/backend protocol messages to be sent via shm_mq, butmight be useful for other purposes as well.shm_mq_set_handle associates a BackgroundWorkerHandle with analready-existing shm_mq_handle. This solves a timing problem whencreating a shm_mq to communicate with a newly-launched backgroundworker: if you attach to the queue first, and the background workerfails to start, you might block forever trying to do I/O on the queue;but if you start the background worker first, but then die beforeattaching to the queue, the background worrker might block forevertrying to do I/O on the queue. This lets you attach before startingthe worker (so that the worker is protected) and then associate theBackgroundWorkerHandle later (so that you are also protected).Patch by me, reviewed by Stephen Frost.1 parentdf630b0 commit7bb0e97
2 files changed
+124
-16
lines changedLines changed: 111 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
142 |
| - | |
| 142 | + | |
143 | 143 |
| |
144 | 144 |
| |
145 | 145 |
| |
| |||
300 | 300 |
| |
301 | 301 |
| |
302 | 302 |
| |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
303 | 314 |
| |
304 | 315 |
| |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
305 | 331 |
| |
306 | 332 |
| |
307 | 333 |
| |
| |||
315 | 341 |
| |
316 | 342 |
| |
317 | 343 |
| |
318 |
| - | |
| 344 | + | |
319 | 345 |
| |
320 | 346 |
| |
321 | 347 |
| |
| 348 | + | |
322 | 349 |
| |
| 350 | + | |
| 351 | + | |
| 352 | + | |
323 | 353 |
| |
324 | 354 |
| |
325 | 355 |
| |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
326 | 360 |
| |
327 | 361 |
| |
328 | 362 |
| |
| |||
348 | 382 |
| |
349 | 383 |
| |
350 | 384 |
| |
351 |
| - | |
352 |
| - | |
353 |
| - | |
354 |
| - | |
355 |
| - | |
356 |
| - | |
| 385 | + | |
| 386 | + | |
357 | 387 |
| |
358 |
| - | |
359 |
| - | |
360 |
| - | |
361 |
| - | |
362 |
| - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
363 | 459 |
| |
364 | 460 |
| |
365 | 461 |
| |
| |||
653 | 749 |
| |
654 | 750 |
| |
655 | 751 |
| |
656 |
| - | |
657 |
| - | |
| 752 | + | |
| 753 | + | |
658 | 754 |
| |
659 | 755 |
| |
660 | 756 |
| |
|
Lines changed: 13 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
28 | 35 |
| |
29 | 36 |
| |
30 | 37 |
| |
| |||
52 | 59 |
| |
53 | 60 |
| |
54 | 61 |
| |
| 62 | + | |
| 63 | + | |
| 64 | + | |
55 | 65 |
| |
56 | 66 |
| |
57 | 67 |
| |
58 | 68 |
| |
59 | 69 |
| |
60 |
| - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
61 | 73 |
| |
62 | 74 |
| |
63 | 75 |
| |
|
0 commit comments
Comments
(0)