zhhyu7 commented on PR #17733:
URL: https://github.com/apache/nuttx/pull/17733#issuecomment-3699471718

   > Why not reuse `net_lock` and extended it to support lock instances? if in 
this way, there's no need to add unlock/lock operations in each branch, which 
can avoid lock imbalance issues and eliminate the need to worry about whether 
to call lock or unlock at the code level.
   
   @anchao If we directly modify the net_lock prototype, too much code needs to 
be changed, moreover, it's possible that some net_lock in external repository 
drivers may be affected, leading to compilation errors. Therefore, each 
relatively independent protocol has added its own global lock. I will submit a 
patch for code format optimization later, changing all device-related protocol 
code to a format similar to the previous net_xxx_wait. For local socket, I can 
also add a unified interface with parameters and breaklock to optimize the code 
in the unlock/wait/lock format. Do you think this is reasonable? 
   
https://github.com/apache/nuttx/pull/17734/files#diff-85924974029d3e344dd6da506275a7cc78cde793d529d8336bed944144beda55R494


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to