From: Huawei Xie Date: Tue, 30 Jun 2015 09:20:50 +0000 (+0800) Subject: vhost: comment unwanted callback X-Git-Tag: spdx-start~8917 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cca619e459a70517665ae87339d65b15e1624032;p=dpdk.git vhost: comment unwanted callback add comment for potential unwanted callback on listenfds Signed-off-by: Huawei Xie --- diff --git a/lib/librte_vhost/vhost_user/fd_man.c b/lib/librte_vhost/vhost_user/fd_man.c index bd30f8dae4..d68b270a20 100644 --- a/lib/librte_vhost/vhost_user/fd_man.c +++ b/lib/librte_vhost/vhost_user/fd_man.c @@ -242,6 +242,13 @@ fdset_event_dispatch(struct fdset *pfdset) pthread_mutex_unlock(&pfdset->fd_mutex); + /* + * When select is blocked, other threads might unregister + * listenfds from and register new listenfds into fdset. + * When select returns, the entries for listenfds in the fdset + * might have been updated. It is ok if there is unwanted call + * for new listenfds. + */ ret = select(maxfds + 1, &rfds, &wfds, NULL, &tv); if (ret <= 0) continue;