diff options
author | RALOVICH, Kristof <tade60@freemail.hu> | 2014-01-19 18:32:13 +0100 |
---|---|---|
committer | RALOVICH, Kristof <tade60@freemail.hu> | 2014-01-19 18:32:13 +0100 |
commit | 701faa01a285d5cdc9b6d210abaac4f7be2838e9 (patch) | |
tree | 9351b5cc83ba494c1e974507cdb7939f98079ce4 /src | |
parent | da11ed3d168a2c2971822ce9f9880ce65409b3a7 (diff) |
AntFr310XT: stop() is not thread safe, or reentrant
Thus hide it!
Diffstat (limited to 'src')
-rw-r--r-- | src/AntFr310XT.cpp | 5 | ||||
-rw-r--r-- | src/AntFr310XT.hpp | 2 | ||||
-rw-r--r-- | src/antpm-downloader.cpp | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/AntFr310XT.cpp b/src/AntFr310XT.cpp index ae4a96c..3690743 100644 --- a/src/AntFr310XT.cpp +++ b/src/AntFr310XT.cpp @@ -103,7 +103,7 @@ AntFr310XT::AntFr310XT(bool eventLoopInBgTh) AntFr310XT::~AntFr310XT() { - m_antMessenger->setCallback(0); + if(m_antMessenger) m_antMessenger->setCallback(0); //m_antMessenger->setHandler(0); m_eventThKill=1; @@ -202,6 +202,9 @@ void AntFr310XT::stop() m_antMessenger->ANT_CloseChannel(chan); m_antMessenger->ANT_ResetSystem(); } + if(m_antMessenger) m_antMessenger->setCallback(0); + //m_antMessenger->setHandler(0); + m_antMessenger.reset(); if(m_serial) m_serial->close(); changeState(ST_ANTFS_START0, true); } diff --git a/src/AntFr310XT.hpp b/src/AntFr310XT.hpp index 169e164..308d3e6 100644 --- a/src/AntFr310XT.hpp +++ b/src/AntFr310XT.hpp @@ -47,7 +47,9 @@ public: virtual void onAntSent(const AntMessage m); void start(); +protected: void stop(); +public: void stopAsync(); const int getSMState() const; diff --git a/src/antpm-downloader.cpp b/src/antpm-downloader.cpp index b5591a8..04ad0e9 100644 --- a/src/antpm-downloader.cpp +++ b/src/antpm-downloader.cpp @@ -243,7 +243,7 @@ main(int argc, char** argv) watch2.start(); - watch2.stop(); + //watch2.stop(); } } |