First round of fixes for re-implemented VFS message queues
This commit is contained in:
parent
419b074b15
commit
e340d89990
@ -149,7 +149,7 @@ int mq_close(mqd_t mqdes)
|
||||
|
||||
/* Decrement the reference count on the inode */
|
||||
|
||||
mq_release(inode);
|
||||
mq_inode_release(inode);
|
||||
}
|
||||
|
||||
return OK;
|
||||
@ -169,7 +169,7 @@ int mq_close(mqd_t mqdes)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void mq_release(FAR struct inode *inode)
|
||||
void mq_inode_release(FAR struct inode *inode)
|
||||
{
|
||||
/* Decrement the reference count on the inode */
|
||||
|
||||
|
@ -231,6 +231,7 @@ mqd_t mq_open(const char *mq_name, int oflags, ...)
|
||||
|
||||
/* Bind the message queue and the inode structure */
|
||||
|
||||
INODE_SET_MQUEUE(inode);
|
||||
inode->u.i_mqueue = msgq;
|
||||
msgq->inode = inode;
|
||||
}
|
||||
|
@ -151,14 +151,15 @@ int mq_unlink(FAR const char *mq_name)
|
||||
UNUSED(ret);
|
||||
|
||||
/* Now we do not release the reference count in the normal way (by calling
|
||||
* inode release. Rather, we call sem_close(). sem_close will decrement
|
||||
* the reference count on the inode. But it will also free the message queue
|
||||
* if that reference count decrements to zero. Since we hold one reference,
|
||||
* that can only occur if the message queue is not in-use.
|
||||
* inode release. Rather, we call mq_inode_release(). mq_inode_release
|
||||
* will decrement the reference count on the inode. But it will also free
|
||||
* the message queue if that reference count decrements to zero. Since we
|
||||
* hold one reference, that can only occur if the message queue is not
|
||||
* in-use.
|
||||
*/
|
||||
|
||||
inode_semgive();
|
||||
mq_release(inode);
|
||||
mq_inode_release(inode);
|
||||
return OK;
|
||||
|
||||
errout_with_semaphore:
|
||||
|
@ -89,7 +89,7 @@ extern "C"
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void mq_release(FAR struct inode *inode);
|
||||
void mq_inode_release(FAR struct inode *inode);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
Reference in New Issue
Block a user