sorele() and ACCEPT_LOCK()

Vijay Singh vijju.singh at gmail.com
Thu Aug 30 00:23:45 UTC 2012


Is there any reason why sorele() needs the accept lock to be held?

  231 #define sorele(so) do {                                                 \
  232         ACCEPT_LOCK_ASSERT();                                           \
  233         SOCK_LOCK_ASSERT(so);                                           \
  234         if ((so)->so_count <= 0)                                        \
  235                 panic("sorele");                                        \
  236         if (--(so)->so_count == 0)                                      \
  237                 sofree(so);                                             \
  238         else {                                                          \
  239                 SOCK_UNLOCK(so);                                        \
  240                 ACCEPT_UNLOCK();                                        \
  241         }                                                               \
  242 } while (0)

-vijay


More information about the freebsd-net mailing list