Fix some unbalanced sched_lock()/sched_unlock() pairs int the re-implemented VFS semaphore and message queue logic

This commit is contained in:
Gregory Nutt
2014-09-29 16:13:07 -06:00
parent e340d89990
commit 5462ede661
5 changed files with 12 additions and 4 deletions
+3 -2
View File
@@ -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;
}
+4 -1
View File
@@ -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;
}