aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhomescreen.cpp
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2017-10-23 14:42:50 +0900
committerZheng Wenlong <wenlong_zheng@nexty-ele.com>2017-10-30 04:21:39 +0000
commit06a2777ce769346ba85aee9f38ccb237a2d72915 (patch)
treed6fffd3399b155ee6cd8c7801a58e19427741722 /src/libhomescreen.cpp
parent46f7c260dd5e79116e7c6571cacbda1b89495c9e (diff)
Remove the redundant thread loop
Because libhomescreen already has a thread to receive events, we can remove the thread loop in libhomescreen. Related Commit: https://gerrit.automotivelinux.org/gerrit/#/c/11403/ BUG-AGL: SPEC-989 Change-Id: I32d65efcf32f3395719837339659ff94b3e64889 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
Diffstat (limited to 'src/libhomescreen.cpp')
-rw-r--r--src/libhomescreen.cpp45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/libhomescreen.cpp b/src/libhomescreen.cpp
index 90ecec2..42ab8b1 100644
--- a/src/libhomescreen.cpp
+++ b/src/libhomescreen.cpp
@@ -18,7 +18,6 @@
#include <sys/socket.h>
#include <iostream>
#include <algorithm>
-#include <thread>
#include <errno.h>
#include <cassert>
#include <cctype>
@@ -80,7 +79,6 @@ static void _on_reply_static(void *closure, struct afb_wsj1_msg *msg)
*/
LibHomeScreen::LibHomeScreen()
{
-
}
/**
@@ -134,8 +132,6 @@ int LibHomeScreen::init(const int port, const string& token)
HMI_DEBUG("libhomescreen","Initialized");
}
- this->runEventloop();
-
return ret;
}
@@ -199,47 +195,6 @@ END:
return -1;
}
-static void *event_loop_run(void *args)
-{
- struct sd_event* loop = (struct sd_event*)(args);
- HMI_DEBUG("libhomescreen","start eventloop");
- for(;;)
- sd_event_run(loop, 30000000);
-}
-
-/**
- * This function start receiving the reply/event message from home screen
- *
- * #### Parameters
- * Nothing
- *
- * #### Return
- * - Returns thread_id on success or -1 in case of error.
- *
- * #### Note
- *
- */
-int LibHomeScreen::runEventloop()
-{
- if(mploop && sp_websock)
- {
- pthread_t thread_id;
- int ret = pthread_create(&thread_id, NULL, event_loop_run, mploop);
- if(ret != 0)
- {
- HMI_ERROR("libhomescreen","Cannot run eventloop due to error:%d", errno);
- return -1;
- }
- else
- return thread_id;
- }
- else
- {
- HMI_ERROR("libhomescreen","Connecting is not established yet");
- return -1;
- }
-}
-
/**
* Sending ShortCut Icon tapped event
*