Call with no lock held or stop_timer and callback may deadlock
| 2139 | |
| 2140 | // Call with no lock held or stop_timer and callback may deadlock |
| 2141 | static void pconnection_tick(pconnection_t *pc) { |
| 2142 | pn_transport_t *t = pc->driver.transport; |
| 2143 | if (pn_transport_get_idle_timeout(t) || pn_transport_get_remote_idle_timeout(t)) { |
| 2144 | if(!stop_timer(pc->context.proactor->timer_queue, &pc->tick_timer)) { |
| 2145 | // TODO: handle error |
| 2146 | } |
| 2147 | uint64_t now = pn_proactor_now_64(); |
| 2148 | uint64_t next = pn_transport_tick(t, now); |
| 2149 | if (next) { |
| 2150 | if (!start_timer(pc->context.proactor->timer_queue, &pc->tick_timer, tick_timer_cb, pc, next - now)) { |
| 2151 | // TODO: handle error |
| 2152 | } |
| 2153 | } |
| 2154 | } |
| 2155 | } |
| 2156 | |
| 2157 | static pconnection_t *get_pconnection(pn_connection_t* c) { |
| 2158 | if (!c) return NULL; |
no test coverage detected