xiaoxiang781216 commented on code in PR #7088: URL: https://github.com/apache/incubator-nuttx/pull/7088#discussion_r999746287
########## include/nuttx/mqueue.h: ########## @@ -85,25 +85,32 @@ # define nxmq_pollnotify(msgq, eventset) #endif -# define MQ_WNELIST(mq) (&((mq)->waitfornotempty)) -# define MQ_WNFLIST(mq) (&((mq)->waitfornotfull)) +# define MQ_WNELIST(cmn) (&((cmn).waitfornotempty)) +# define MQ_WNFLIST(cmn) (&((cmn).waitfornotfull)) /**************************************************************************** * Public Type Declarations ****************************************************************************/ +/* Common prologue of all message queue structures. */ + +struct mqueue_cmn_s +{ + dq_queue_t waitfornotempty; /* Task list waiting for not empty */ + dq_queue_t waitfornotfull; /* Task list waiting for not full */ + int16_t nwaitnotfull; /* Number tasks waiting for not full */ + int16_t nwaitnotempty; /* Number tasks waiting for not empty */ +}; + /* This structure defines a message queue */ struct mqueue_inode_s { + struct mqueue_cmn_s cmn; /* Common prologue */ Review Comment: This follow task_tcb_s and pthread_tcb_s name the shared state as `struct tcb_s cmn` -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org