mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
sched/spawn: remove spawn proxy thread to simplify task/posix_spawn()
The spawn proxy thread is a special existence in NuttX, usually some developers spend a lot of time on stack overflow of spawn proxy thread: https://github.com/apache/nuttx/issues/9046 https://github.com/apache/nuttx/pull/9081 In order to avoid similar issues, this PR will remove spawn proxy thread to simplify the process of task/posix_spawn(). 1. Postpone the related processing of spawn file actions until after task_init() 2. Delete the temporary thread of spawn proxy and related global variables Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
* exported by the caller and made available for linking the
|
||||
* module into the system.
|
||||
* nexports - The number of symbols in the exports table.
|
||||
* actions - The spawn file actions
|
||||
* attr - The spawn attributes.
|
||||
*
|
||||
* Returned Value:
|
||||
@@ -72,7 +73,8 @@
|
||||
|
||||
int exec_spawn(FAR const char *filename, FAR char * const *argv,
|
||||
FAR char * const *envp, FAR const struct symtab_s *exports,
|
||||
int nexports, FAR const posix_spawnattr_t *attr)
|
||||
int nexports, FAR const posix_spawn_file_actions_t *actions,
|
||||
FAR const posix_spawnattr_t *attr)
|
||||
{
|
||||
FAR struct binary_s *bin;
|
||||
int pid;
|
||||
@@ -128,7 +130,7 @@ int exec_spawn(FAR const char *filename, FAR char * const *argv,
|
||||
|
||||
/* Then start the module */
|
||||
|
||||
pid = exec_module(bin, filename, argv, envp);
|
||||
pid = exec_module(bin, filename, argv, envp, actions);
|
||||
if (pid < 0)
|
||||
{
|
||||
ret = pid;
|
||||
@@ -239,7 +241,7 @@ int exec(FAR const char *filename, FAR char * const *argv,
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = exec_spawn(filename, argv, envp, exports, nexports, NULL);
|
||||
ret = exec_spawn(filename, argv, envp, exports, nexports, NULL, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
set_errno(-ret);
|
||||
|
||||
Reference in New Issue
Block a user