else if (FD_ISSET(fd, &fds)) {
struct listnode *newln;
thr = XCALLOC(MTYPE_TMP, sizeof(struct thread *));
- thread_add_read(agentx_tm, agentx_read, NULL, fd, thr);
+
newln = listnode_add_before(events, ln, thr);
- (*thr)->arg = newln;
+ thread_add_read(agentx_tm, agentx_read, newln, fd, thr);
}
}
static void c_callback(struct thread *thread)
{
- auto _tag = static_cast<RpcStateBase *>(thread->arg);
+ auto _tag = static_cast<RpcStateBase *>(THREAD_ARG(thread));
/*
* We hold the lock until the callback finishes and has updated
* _tag->state, then we signal done and release.
*/
static void vrrp_read(struct thread *thread)
{
- struct vrrp_router *r = thread->arg;
+ struct vrrp_router *r = THREAD_ARG(thread);
struct vrrp_pkt *pkt;
ssize_t pktsize;
*/
static void vrrp_adver_timer_expire(struct thread *thread)
{
- struct vrrp_router *r = thread->arg;
+ struct vrrp_router *r = THREAD_ARG(thread);
DEBUGD(&vrrp_dbg_proto,
VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
*/
static void vrrp_master_down_timer_expire(struct thread *thread)
{
- struct vrrp_router *r = thread->arg;
+ struct vrrp_router *r = THREAD_ARG(thread);
zlog_info(VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
"Master_Down_Timer expired",