First round of fixes for re-implemented VFS message queues

This commit is contained in:
Gregory Nutt 2014-09-29 16:03:56 -06:00
parent 419b074b15
commit e340d89990
4 changed files with 10 additions and 8 deletions

View File

@ -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 */

View File

@ -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;
}

View File

@ -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:

View File

@ -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