rtptable
struct rtptable rtptable;
if (rtptable.rtp_count == 0)
if (rtptable.rtp_count == 0)
if (rtptable.rtp_count == 0)
if (rtptable.rtp_count == 0)
if (rtptable.rtp_count == 0)
rw_init(&rtptable.rtp_lk, "rtsock");
TAILQ_INIT(&rtptable.rtp_list);
if (rtptable.rtp_count == 0)
rw_enter(&rtptable.rtp_lk, RW_WRITE);
TAILQ_INSERT_TAIL(&rtptable.rtp_list, rop, rop_list);
rtptable.rtp_count++;
rw_exit(&rtptable.rtp_lk);
rw_enter(&rtptable.rtp_lk, RW_WRITE);
rtptable.rtp_count--;
TAILQ_REMOVE(&rtptable.rtp_list, rop, rop_list);
rw_exit(&rtptable.rtp_lk);
rw_enter_read(&rtptable.rtp_lk);
TAILQ_FOREACH(rop, &rtptable.rtp_list, rop_list) {
rw_exit_read(&rtptable.rtp_lk);
if (rtptable.rtp_count == 0) {