Call with lock held. Leave unchanged if events pending. Return true if there is an event in the collector
| 3221 | // Call with lock held. Leave unchanged if events pending. |
| 3222 | // Return true if there is an event in the collector |
| 3223 | static bool proactor_update_batch(pn_proactor_t *p) { |
| 3224 | if (proactor_has_event(p)) |
| 3225 | return true; |
| 3226 | if (p->need_timeout) { |
| 3227 | p->need_timeout = false; |
| 3228 | proactor_add_event(p, PN_PROACTOR_TIMEOUT); |
| 3229 | return true; |
| 3230 | } |
| 3231 | if (p->need_interrupt) { |
| 3232 | p->need_interrupt = false; |
| 3233 | proactor_add_event(p, PN_PROACTOR_INTERRUPT); |
| 3234 | return true; |
| 3235 | } |
| 3236 | if (p->need_inactive) { |
| 3237 | p->need_inactive = false; |
| 3238 | proactor_add_event(p, PN_PROACTOR_INACTIVE); |
| 3239 | return true; |
| 3240 | } |
| 3241 | return false; |
| 3242 | } |
| 3243 | |
| 3244 | static pn_event_t *proactor_batch_next(pn_event_batch_t *batch) { |
| 3245 | pn_proactor_t *p = batch_proactor(batch); |
no test coverage detected