Reimplement recursion protection, checking whether current thread holds

sockbuf mutex.

Reviewed by:	rwatson
This commit is contained in:
Gleb Smirnoff 2005-02-19 14:41:49 +00:00
parent 949d92c657
commit f1c6a420b1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142092

View File

@ -897,6 +897,12 @@ ng_ksocket_rcvdata(hook_p hook, item_p item)
struct mbuf *m;
struct sa_tag *stag;
/* Avoid reentrantly sending on the socket */
if (SOCKBUF_OWNED(&so->so_snd)) {
NG_FREE_ITEM(item);
return (EDEADLK);
}
/* Extract data */
NGI_GET_M(item, m);
NG_FREE_ITEM(item);