Add CreateTaskQueue for early initialization 57/263457/2
authorDongHyun Song <dh81.song@samsung.com>
Fri, 3 Sep 2021 01:50:24 +0000 (10:50 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Fri, 3 Sep 2021 02:44:34 +0000 (11:44 +0900)
This API will be used by global wrt-service (thread model)
This singleton TaskQueue instance should have smack label same as
pid's smack label.
After a service app is launched, this TaskQueue thread has app's
smack label. Then, smack violation might be happened.
Thus, to initialize early before app creation, this patch exposes
CreateTaskQueue() funtion for WebRuntime.

Change-Id: I108bed31dbf0dbd1b54a6781530b95618584b0f8
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
src/common/task-queue.cpp

index ef58b5d..139f554 100644 (file)
@@ -78,3 +78,12 @@ void TaskQueue::ScheduleWorkInMainThread(const std::function<void()>& work) {
 }
 
 }  // namespace common
+
+extern "C" {
+
+__attribute__ ((visibility("default"))) void CreateTaskQueue() {
+  common::TaskQueue::GetInstance();
+  LoggerI("Create TaskQueue");
+}
+
+}