Skip to content
Snippets Groups Projects
Commit 5462ede6 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

Fix some unbalanced sched_lock()/sched_unlock() pairs int the re-implemented...

Fix some unbalanced sched_lock()/sched_unlock() pairs int the re-implemented VFS semaphore and message queue logic
parent e340d899
No related branches found
No related tags found
No related merge requests found
......@@ -150,6 +150,7 @@ int mq_close(mqd_t mqdes)
/* Decrement the reference count on the inode */
mq_inode_release(inode);
sched_unlock();
}
return OK;
......
......@@ -235,9 +235,10 @@ mqd_t mq_open(const char *mq_name, int oflags, ...)
inode->u.i_mqueue = msgq;
msgq->inode = inode;
}
sched_unlock();
}
sched_unlock();
return mqdes;
errout_with_msgq:
......
......@@ -160,6 +160,7 @@ int mq_unlink(FAR const char *mq_name)
inode_semgive();
mq_inode_release(inode);
sched_unlock();
return OK;
errout_with_semaphore:
......@@ -168,5 +169,6 @@ errout_with_inode:
inode_release(inode);
errout:
set_errno(errcode);
sched_unlock();
return ERROR;
}
......@@ -255,16 +255,17 @@ FAR sem_t *sem_open (FAR const char *name, int oflags, ...)
sem = &nsem->ns_sem;
}
sched_unlock();
}
sched_unlock();
return sem;
errout_with_inode:
inode_release(inode);
errout_with_lock:
sched_unlock();
set_errno(errcode);
sched_unlock();
return (FAR sem_t *)ERROR;
}
......
......@@ -162,7 +162,9 @@ int sem_unlink(FAR const char *name)
*/
inode_semgive();
return sem_close((FAR sem_t *)inode->u.i_nsem);
ret = sem_close((FAR sem_t *)inode->u.i_nsem);
sched_unlock();
return ret;
errout_with_semaphore:
inode_semgive();
......@@ -170,5 +172,6 @@ errout_with_inode:
inode_release(inode);
errout:
set_errno(errcode);
sched_unlock();
return ERROR;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment