Clarify purpose of master->io_sem

In order to ensure proper use of locking, the purpose of each mutex/semaphore
must be clear and documented.

This is my best guess.  The master->io_sem has a simple purpose, synchronizing
access to the master->datagram_queue list structure.
This commit is contained in:
Esben Haabendal 2021-06-24 13:38:04 +02:00 committed by Rasmus Villemoes
parent fa890a8b61
commit e243c6b7db
1 changed files with 1 additions and 2 deletions

View File

@ -260,6 +260,7 @@ struct ec_master {
struct list_head datagram_queue; /**< Datagram queue. */
uint8_t datagram_index; /**< Current datagram index. */
ec_lock_t io_sem; /**< Semaphore protecting the datagram_queue. */
struct list_head ext_datagram_queue; /**< Queue for non-application
datagrams. */
@ -290,8 +291,6 @@ struct ec_master {
struct list_head eoe_handlers; /**< Ethernet over EtherCAT handlers. */
#endif
ec_lock_t io_sem; /**< Semaphore used in \a IDLE phase. */
void (*send_cb)(void *); /**< Current send datagrams callback. */
void (*receive_cb)(void *); /**< Current receive datagrams callback. */
void *cb_data; /**< Current callback data. */