mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
net/tcp: Fix a deadlock condition that can occur when (1) all network logic runs on a single work queue, (1) TCP write buffering is enabled, and (2) we run out of IOBs. In this case, the TCP write buffering logic was blocking on iob_alloc() with the network locked. Since the network was locked, the device driver polls that would provide take the write buffer data and release the IOBs could not execute. This fixes the problem by unlocking the network lock while waiting for the IOBs.
This commit is contained in:
@@ -86,6 +86,27 @@ struct timeval; /* Forward reference */
|
||||
|
||||
void net_lockinitialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: net_breaklock
|
||||
*
|
||||
* Description:
|
||||
* Break the lock, return information needed to restore re-entrant lock
|
||||
* state.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int net_breaklock(FAR unsigned int *count);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: net_breaklock
|
||||
*
|
||||
* Description:
|
||||
* Restore the locked state
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void net_restorelock(unsigned int count);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: net_dsec2timeval
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user