From: DongHyun Song Date: Fri, 4 Jun 2021 02:32:21 +0000 (+0900) Subject: [Service][Workaround] Make singleton worker thread before app start X-Git-Tag: submit/tizen/20210630.160022^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d187f96060e9c367e861017b61cef832c9aa163;p=platform%2Fframework%2Fweb%2Fwrtjs.git [Service][Workaround] Make singleton worker thread before app start This patch will make singleton webapi worker thread ahead of app launching to keep it 'User' smack label. There are lots usage of putting message at singleton worker thread by - TaskQueue::GetInstance().Queue() - TaskQueue::GetInstance().Async() tizen.systeminfo.getPropertyValue() is one of API to use TaskQueue singleton instance. + remove unnecessary log Related patch of filesystem webapi worker issue: https://review.tizen.org/gerrit/#/c/platform/core/api/webapi-plugins/+/259382/ Change-Id: I7e0abe5e93335d2798bc388f22a88aff754d8d2b Signed-off-by: DongHyun Song --- diff --git a/wrt_app/common/service_runner.ts b/wrt_app/common/service_runner.ts index 3b5c308a..93be76e6 100644 --- a/wrt_app/common/service_runner.ts +++ b/wrt_app/common/service_runner.ts @@ -78,16 +78,21 @@ export function start(id: string, filename: string) { console.log(`serviceType : ${global['serviceType']}`) new DeviceAPIRouter(id, isGlobalService()); + // this is workaround solution to make webapis singleton worker + // ahead of dropThreadPrivilege() + global.tizen.systeminfo.getPropertyValue("CPU", () => { }, () => { }); + + // This is for awaking up uv loop. + dummyTimer = setInterval(() => { + checkLauncherAlive(id); + }, 100); + if (isServiceApplication()) { registerExtensionResolver(id); filename = wrt.getStartServiceFile(id); console.log(`start global service file: ${filename}`); } - // This is for awaking up uv loop. - dummyTimer = setInterval(() => { - checkLauncherAlive(id); - }, 100); printAppControlData(id); try { diff --git a/wrt_app/service/device_api_router.ts b/wrt_app/service/device_api_router.ts index 3347e61f..ae2fd535 100644 --- a/wrt_app/service/device_api_router.ts +++ b/wrt_app/service/device_api_router.ts @@ -311,7 +311,6 @@ export class DeviceAPIRouter { injectVirtualRootResolver(func: Function) { return (...args: any[]) => { - console.log('arguments : ' + args); if (args.length && !(args[0] === null || args[0] === undefined)) { args[0] = wrt.resolveVirtualRoot(this.getServiceId(), args[0]); console.log('updated argument[0] : ' + args[0]);