| 791 | } |
| 792 | |
| 793 | void Connection::wakeUpEventLoopIfMessagesInQueue() |
| 794 | { |
| 795 | // We need this in two cases: |
| 796 | // 1. When doing a sync call, other D-Bus messages may have arrived, waiting in the read queue. |
| 797 | // In case an event loop is inside a poll in another thread, or an external event loop polls in the |
| 798 | // same thread but as an unrelated event source, then we need to wake up the poll explicitly so the |
| 799 | // event loop 1. processes all messages in the read queue, 2. updates poll timeout before next poll. |
| 800 | // 2. Additionally, when sending out messages, these may be too long to be sent out entirely within |
| 801 | // the single sd_bus_send() or sd_bus_call_async() call, in which case they are queued in the write |
| 802 | // queue. We need to wake up the event loop to continue sending the message until it's fully sent. |
| 803 | if (arePendingMessagesInQueues()) |
| 804 | notifyEventLoopToWakeUpFromPoll(); |
| 805 | } |
| 806 | |
| 807 | void Connection::joinWithEventLoop() |
| 808 | { |
nothing calls this directly
no outgoing calls
no test coverage detected