Skip to content
Snippets Groups Projects
Unverified Commit b97ab280 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

icetransport: use default initializer to avoid locks

Change-Id: I74057cb5a6870875a3d8d7600397aee9fbd361da
parent a226c547
No related branches found
No related tags found
No related merge requests found
...@@ -116,20 +116,20 @@ public: ...@@ -116,20 +116,20 @@ public:
IpAddr getLocalAddress(unsigned comp_id) const; IpAddr getLocalAddress(unsigned comp_id) const;
IpAddr getRemoteAddress(unsigned comp_id) const; IpAddr getRemoteAddress(unsigned comp_id) const;
std::unique_ptr<pj_pool_t, std::function<void(pj_pool_t*)>> pool_; std::unique_ptr<pj_pool_t, std::function<void(pj_pool_t*)>> pool_ {};
IceTransportCompleteCb on_initdone_cb_; IceTransportCompleteCb on_initdone_cb_ {};
IceTransportCompleteCb on_negodone_cb_; IceTransportCompleteCb on_negodone_cb_ {};
IceRecvInfo on_recv_cb_; IceRecvInfo on_recv_cb_ {};
mutable std::mutex iceMutex_ {}; mutable std::mutex iceMutex_ {};
std::unique_ptr<pj_ice_strans, IceSTransDeleter> icest_; std::unique_ptr<pj_ice_strans, IceSTransDeleter> icest_;
unsigned component_count_; unsigned component_count_ {};
pj_ice_sess_cand cand_[MAX_CANDIDATES] {}; pj_ice_sess_cand cand_[MAX_CANDIDATES] {};
std::string local_ufrag_; std::string local_ufrag_ {};
std::string local_pwd_; std::string local_pwd_ {};
pj_sockaddr remoteAddr_; pj_sockaddr remoteAddr_ {};
std::condition_variable iceCV_ {}; std::condition_variable iceCV_ {};
pj_ice_strans_cfg config_; pj_ice_strans_cfg config_ {};
std::string last_errmsg_; std::string last_errmsg_ {};
std::atomic_bool is_stopped_ {false}; std::atomic_bool is_stopped_ {false};
...@@ -138,10 +138,10 @@ public: ...@@ -138,10 +138,10 @@ public:
Packet(void* pkt, pj_size_t size) Packet(void* pkt, pj_size_t size)
: data {reinterpret_cast<char*>(pkt), reinterpret_cast<char*>(pkt) + size} : data {reinterpret_cast<char*>(pkt), reinterpret_cast<char*>(pkt) + size}
{} {}
std::vector<char> data; std::vector<char> data {};
}; };
std::vector<PeerChannel> peerChannels_; std::vector<PeerChannel> peerChannels_ {};
struct ComponentIO struct ComponentIO
{ {
...@@ -151,7 +151,7 @@ public: ...@@ -151,7 +151,7 @@ public:
IceRecvCb cb; IceRecvCb cb;
}; };
std::vector<ComponentIO> compIO_; std::vector<ComponentIO> compIO_ {};
std::atomic_bool initiatorSession_ {true}; std::atomic_bool initiatorSession_ {true};
...@@ -182,25 +182,25 @@ public: ...@@ -182,25 +182,25 @@ public:
void setDefaultRemoteAddress(int comp_id, const IpAddr& addr); void setDefaultRemoteAddress(int comp_id, const IpAddr& addr);
const IpAddr& getDefaultRemoteAddress(int comp_id) const; const IpAddr& getDefaultRemoteAddress(int comp_id) const;
std::unique_ptr<upnp::Controller> upnp_; std::unique_ptr<upnp::Controller> upnp_ {};
std::mutex upnpMutex_; std::mutex upnpMutex_ {};
bool onlyIPv4Private_ {true}; bool onlyIPv4Private_ {true};
// IO/Timer events are handled by following thread // IO/Timer events are handled by following thread
std::thread thread_; std::thread thread_ {};
std::atomic_bool threadTerminateFlags_ {false}; std::atomic_bool threadTerminateFlags_ {false};
bool handleEvents(unsigned max_msec); bool handleEvents(unsigned max_msec);
// Wait data on components // Wait data on components
pj_ssize_t lastSentLen_; pj_ssize_t lastSentLen_ {};
std::condition_variable waitDataCv_ = {}; std::condition_variable waitDataCv_ = {};
std::atomic_bool destroying_ {false}; std::atomic_bool destroying_ {false};
onShutdownCb scb; onShutdownCb scb {};
// Default remote adresses // Default remote adresses
std::vector<IpAddr> iceDefaultRemoteAddr_; std::vector<IpAddr> iceDefaultRemoteAddr_ {};
}; };
//============================================================================== //==============================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment