mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
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:
+1
-17
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user