wangchdo commented on code in PR #17223:
URL: https://github.com/apache/nuttx/pull/17223#discussion_r2455134817
##########
include/nuttx/event.h:
##########
@@ -73,7 +73,6 @@ struct nxevent_s
{
struct list_node list; /* Waiting list of nxevent_wait_t */
volatile nxevent_mask_t events; /* Pending Events */
- spinlock_t lock; /* Spinlock */
Review Comment:
This is mainly for removing reliance on semaphore
Semaphore is too heavy:
1. It has global lock inside the api
2. Semaphore object costs more memory
3. It has lost of unrelated logic
Indeed the lock scope is very small in event, and after removing semaphore
it is smaller, so i think this would be better
By the way The current spinlock is also a global one for event post, it uses
spinlock_unpreemt api.
How do you think?
--
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]