summaryrefslogtreecommitdiff
path: root/utils/MsgTask.h
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2015-09-11 19:40:25 -0700
committerKevin Tang <zhikait@codeaurora.org>2015-09-21 14:45:58 -0700
commit94ecbf68045cb44f6b6287621007ac845ed88ee2 (patch)
tree238cfd22f18ec89b97d1342d8276cc61fb716fa5 /utils/MsgTask.h
parent049cc84d3a9df23f92fda74845c5f4dd95507c23 (diff)
downloadgps-94ecbf68045cb44f6b6287621007ac845ed88ee2.tar.gz
Crash fix with MsgTask API change
Removed tCreate and tAssociate from MsgTask. LocThread now can optionally take a tCreate method. Associator is replaced with *firstMsg* option to MsgTask, which is a more generic option, that can associate or do other set up job at the create of a MsgTask. The current MsgTask doesn't use tCreate, which exposes a slight time window for Location HAL when its MsgTask is NOT associated to DVM heap but a message delivery to DVM could be attempted during this time. Change-Id: Iafd5b91b693baacb9b7064463f8c44f74026f54c CRs-Fixed: 902350
Diffstat (limited to 'utils/MsgTask.h')
-rw-r--r--utils/MsgTask.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/utils/MsgTask.h b/utils/MsgTask.h
index c397ee1..9eb1f56 100644
--- a/utils/MsgTask.h
+++ b/utils/MsgTask.h
@@ -30,10 +30,6 @@
#define __MSG_TASK__
#include <LocThread.h>
-// TODO: remove this include in the next patch
-#include <pthread.h>
-
-namespace loc_core {
struct LocMsg {
inline LocMsg() {}
@@ -42,13 +38,14 @@ struct LocMsg {
inline virtual void log() const {}
};
-class MsgTask : public LocRunnable{
+class MsgTask : public LocRunnable {
const void* mQ;
LocThread* mThread;
friend class LocThreadDelegate;
protected:
virtual ~MsgTask();
public:
+ MsgTask(LocThread::tCreate tCreator, const char* threadName = NULL, bool joinable = true);
MsgTask(const char* threadName = NULL, bool joinable = true);
// this obj will be deleted once thread is deleted
void destroy();
@@ -65,16 +62,6 @@ public:
// The method to be run after thread loop (conditionally repeatedly)
// calls run()
inline virtual void postrun() {}
-
- // TODO: remove the below in the next patch
- typedef void* (*tStart)(void*);
- typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg);
- typedef int (*tAssociate)();
- MsgTask(tCreate tCreator, const char* threadName);
- MsgTask(tAssociate tAssociator, const char* threadName);
- void associate(tAssociate tAssociator) const;
};
-} // namespace loc_core
-
#endif //__MSG_TASK__