Enhance app manager (#1011)

Add app_manager_is_started API per requested by #1004 to support
checking the status of app manager in another thread.
This commit is contained in:
Wenyong Huang 2022-02-17 15:04:52 +08:00 committed by GitHub
parent 3fe191b0df
commit 9fc124b06f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -13,6 +13,7 @@
/* Queue of app manager */
static bh_queue *g_app_mgr_queue;
static bool g_app_mgr_started;
void *
get_app_manager_queue()
@ -381,9 +382,13 @@ app_manager_startup(host_interface *interface)
app_manager_printf("App Manager started.\n");
g_app_mgr_started = true;
/* Enter loop run */
bh_queue_enter_loop_run(g_app_mgr_queue, app_manager_queue_callback, NULL);
g_app_mgr_started = false;
/* Destroy registered resources */
am_cleanup_registeration(ID_APP_MGR);
@ -397,6 +402,12 @@ fail1:
bh_queue_destroy(g_app_mgr_queue);
}
bool
app_manager_is_started(void)
{
return g_app_mgr_started;
}
#include "module_config.h"
module_interface *g_module_interfaces[Module_Max] = {

View File

@ -183,6 +183,10 @@ app_manager_host_init(host_interface *intf);
void
app_manager_startup(host_interface *intf);
/* Return whether app manager is started */
bool
app_manager_is_started(void);
/* Get queue of current applet */
void *
app_manager_get_module_queue(uint32 module_type, void *module_inst);