diff options
Diffstat (limited to 'src/components/transport_manager/include/transport_manager/transport_manager_impl.h')
-rw-r--r-- | src/components/transport_manager/include/transport_manager/transport_manager_impl.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h index 4c38716f3f..62fdb3fa2e 100644 --- a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h +++ b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h @@ -33,12 +33,15 @@ #ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_ #define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_ +#include <pthread.h> + #include <queue> #include <map> #include <list> #include <algorithm> #include "utils/timer_thread.h" +#include "utils/rwlock.h" #include "transport_manager/transport_manager.h" #include "transport_manager/transport_manager_listener.h" @@ -101,12 +104,6 @@ class TransportManagerImpl : public TransportManager, virtual int Init(); /** - * Reinitializes transport manager - * @return Error code - */ - virtual int Reinit(); - - /** * @brief Start scanning for new devices. * * @return Code error. @@ -253,6 +250,12 @@ class TransportManagerImpl : public TransportManager, **/ void PostEvent(const TransportAdapterEvent& event); + /** + * @brief flag that indicates that thread is active + * if it is false then threads exist main loop + **/ + volatile bool all_thread_active_; + typedef std::list<TransportManagerListener*> TransportManagerListenerList; /** * @brief listener that would be called when TM's event happened. @@ -260,6 +263,11 @@ class TransportManagerImpl : public TransportManager, TransportManagerListenerList transport_manager_listener_; /** + * @brief Condition variable to wake up event + **/ + pthread_cond_t device_listener_thread_wakeup_; + + /** * @brief Flag that TM is initialized */ bool is_initialized_; @@ -344,9 +352,6 @@ class TransportManagerImpl : public TransportManager, unsigned char** frame); void OnDeviceListUpdated(TransportAdapter* ta); - void DisconnectAllDevices(); - void TerminateAllAdapters(); - int InitAllAdapters(); static Connection convert(const ConnectionInternal& p); }; // class ; |