[Service] Refactor stop service sequence 91/245591/4
authorDongHyun Song <dh81.song@samsung.com>
Tue, 13 Oct 2020 01:20:10 +0000 (10:20 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Tue, 13 Oct 2020 01:43:58 +0000 (10:43 +0900)
commitdd79b18738cdb66f003a5195e78b5ff03248e27e
treea61c6bf7314722e49cb18a98e68a264b9dcbeb0a
parentde7f2584aaeca8fa264bd539a5be2cb938fe83d9
[Service] Refactor stop service sequence

When service application needs to terminate by tizen://exit, it
should call wrt.stopService(id).

However, it is called in worker thread with standalone model,
WRTServiceManager::Remove() will be handled in worker thread, not
main thread. then, uv loop sometimes makes abort() or get SIGSEGV.
Then, wrt.stopService(id) should be called in main thread side.

Change-Id: I103bf8f38111db984bb22d0af56c05456851b681
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/common/service_manager.ts
wrt_app/common/service_runner.ts
wrt_app/service/builtins/wasm_builder.ts