mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-17 15:32:21 +08:00
nsh:support wait command to wait task exit.
usage like: nsh> sleep 10 & [5:100] nsh>set pid1=$! nsh>sleep 15 & [6:100] nsh>set pid2=$! nsh>wait $pid1 $pid2 'wait' command will block nsh from running until pid1 and pid2 finish. This is useful for parallel requirements to perform certain tasks Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
@@ -1231,6 +1231,11 @@ int cmd_alias(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
int cmd_unalias(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_NSH_DISABLE_WAIT) && defined(CONFIG_SCHED_WAITPID) && \
|
||||
!defined(CONFIG_DISABLE_PTHREAD)
|
||||
int cmd_wait(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nsh_extmatch_count
|
||||
*
|
||||
|
Reference in New Issue
Block a user