Squashed commit of the following:

net/utils:  return from net_breaklock() was being clobbered.
    net/:  Replace all calls to iob_alloc() with calls to net_ioballoc() which will release the network lock, if necessary.
    net/utils, tcp, include/net:  Separate out the special IOB allocation logic and place it in its own function.  Prototype is available in a public header file where it can also be used by network drivers.
    net/utils: net_timedwait() now uses new net_breaklock() and net_restorelock().
This commit is contained in:
Gregory Nutt
2018-07-07 08:26:13 -06:00
parent 75cc19ebb4
commit 427b3b8fcb
8 changed files with 110 additions and 59 deletions
+1 -17
View File
@@ -161,23 +161,7 @@ FAR struct tcp_wrbuffer_s *tcp_wrbuffer_alloc(void)
/* Now get the first I/O buffer for the write buffer structure */
wrb->wb_iob = iob_tryalloc(false);
if (wrb->wb_iob == NULL)
{
unsigned int count;
int ret;
/* There are no buffers available now. We will have to wait for one to
* become available. But let's not do that with the network locked.
*/
ret = net_breaklock(&count);
wrb->wb_iob = iob_alloc(false);
if (ret >= 0)
{
net_restorelock(count);
}
}
wrb->wb_iob = net_ioballoc(false);
/* Did we get an IOB? We should always get one except under some really weird
* error conditions.