After applying this patch, amd uses tizen-core mainloop instead of gmainloop.
Change-Id: Ide72e7a3856804861898b6c5c06b928e2a4bd1b5
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
PKG_CHECK_MODULES(SENSOR_DEPS REQUIRED sensor)
PKG_CHECK_MODULES(SQLITE3_DEPS REQUIRED sqlite3)
PKG_CHECK_MODULES(TANCHOR_DEPS REQUIRED tanchor)
+PKG_CHECK_MODULES(TIZEN_CORE_DEPS REQUIRED tizen-core)
PKG_CHECK_MODULES(TIZEN_DATABASE_DEPS REQUIRED tizen-database)
PKG_CHECK_MODULES(TIZEN_EXTENSION_CLIENT_DEPS REQUIRED tizen-extension-client)
PKG_CHECK_MODULES(TIZEN_LAUNCH_CLIENT_DEPS REQUIRED tizen-launch-client)
Requires(postun): /sbin/ldconfig
Requires(postun): /usr/bin/systemctl
Requires(preun): /usr/bin/systemctl
+Requires: tizen-core
Requires: tizen-platform-config
BuildRequires: cmake
BuildRequires: pkgconfig(sensor)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(tanchor)
+BuildRequires: pkgconfig(tizen-core)
BuildRequires: pkgconfig(tizen-database)
BuildRequires: pkgconfig(tizen-extension-client)
BuildRequires: pkgconfig(tizen-launch-client)
PKGMGR_DEPS
PKGMGR_INFO_DEPS
SQLITE3_DEPS
+ TIZEN_CORE_DEPS
TIZEN_DATABASE_DEPS
TIZEN_SHARED_QUEUE_DEPS
TTRACE_DEPS
#include <sys/stat.h>
#include <sys/types.h>
#include <systemd/sd-daemon.h>
+#include <tizen_core.h>
#include <unistd.h>
#include <list>
extern "C" EXPORT int amd_main(int argc, char** argv) {
amd::CPUBoostController::DoBoost(getpid(),
amd::CPUBoostController::Level::Strong, -1);
+ tizen_core_init();
+
if (Initialize() != 0) {
_E("AMD initialization is failed");
return -1;
return G_SOURCE_REMOVE;
}, nullptr);
- GMainLoop* loop = g_main_loop_new(nullptr, FALSE);
- if (loop == nullptr) {
- _E("g_main_loop_new() is failed");
+ tizen_core_h core = nullptr;
+ int ret = tizen_core_task_create("main", false, &core);
+ if (ret != TIZEN_CORE_ERROR_NONE) {
+ _E("tizen_core_task_create() is failed. error(%d)", ret);
return -1;
}
_W("AMD_LOOP_START");
- g_main_loop_run(loop);
+ tizen_core_task_run(core);
_W("AMD_LOOP_END");
- g_main_loop_unref(loop);
Finalize();
+
+ tizen_core_shutdown();
return 0;
}