Date: Mon, 31 Jan 2011 21:54:33 -0800 From: Jim <uukkhh@gmail.com> To: freebsd-net@freebsd.org Subject: why use INP_WLOCK instead of INP_RLOCK Message-ID: <AANLkTinrVJ4jehNm7xh=ix7k3r0Q0YY38nc59AkgiP_P@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi All, I am not sure if anybody has asked it before. I could not find answer by doing rough search on Internet, if it is duplicate question, sorry in advance. My question is that, for getting socket options in tcp_ctloutput() in tcp_usrreq.c, why do we need to do lock with INP_WLOCK(inp) as setting socket options does. Why do we just use INP_RLOCK(inp), as it looks not changing anything in tcp control block? Thank you for your kindly answer. Jim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinrVJ4jehNm7xh=ix7k3r0Q0YY38nc59AkgiP_P>