xiaoxiang781216 commented on code in PR #6965: URL: https://github.com/apache/incubator-nuttx/pull/6965#discussion_r995870773
########## drivers/mtd/mtd_config.c: ########## @@ -1807,7 +1807,7 @@ int mtdconfig_unregister(void) inode = file.f_inode; dev = (FAR struct mtdconfig_struct_s *)inode->i_private; - nxmutex_destroy(&dev->exclsem); + nxsem_destroy(&dev->exclsem); Review Comment: Since exclsem is used as resource count(ensure only one caller can open it at the same time): 1. Call nxsem_wait in mtdconfig_open 2. Call nxsem_post in mtdconfig_close Only nxsem_wait/nxsem_post is called in pair can be replaced by mutex_lock/mutex_unlock. -- 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