Lock the scheduler when starting NSH builtin applications to eliminate race conditions

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4988 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-07-28 18:38:13 +00:00
parent cea531d7dc
commit 52fe89eb98
3 changed files with 75 additions and 38 deletions

View File

@@ -492,6 +492,8 @@ static int cmd_exit(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* Exectue the command in argv[0]
*
* Returned Value:
* <0 If exec_namedapp() fails, then the negated errno value
* is returned.
* -1 (ERRROR) if the command was unsuccessful
* 0 (OK) if the command was successful
* 1 if an application task was spawned successfully, but
@@ -521,8 +523,8 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, int argc, char *argv[])
#ifdef CONFIG_NSH_BUILTIN_APPS
ret = nsh_execapp(vtbl, cmd, argv);
/* The pre-built application was successfully started -- return OK
* or 1 if it returned a non-zero exit status.
/* If the built-in application was successfully started, return OK
* or 1 (if the application returned a non-zero exit status).
*/
if (ret >= 0)