From dc3e77c4284b84b71ddabf1a813b18224b775217 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 17 Mar 2008 18:48:16 +0000 Subject: finally added callIdQueue (sorry) threads get started @ sync now TODO: cleanup threads and session on daed --- rtpSessionTable.cpp | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'rtpSessionTable.cpp') diff --git a/rtpSessionTable.cpp b/rtpSessionTable.cpp index 8b361a4..5beb3d6 100644 --- a/rtpSessionTable.cpp +++ b/rtpSessionTable.cpp @@ -54,21 +54,7 @@ RtpSessionTable::~RtpSessionTable() { } -void RtpSessionTable::addSession(const std::string & call_id, RtpSession* ses ) -{ - Lock lock(mutex_); - - - std::pair ret = map_.insert(RtpSessionMap::value_type(call_id,ses)); - if(!ret.second) - { - map_.erase(ret.first); - map_.insert(RtpSessionMap::value_type(call_id,ses)); - } -} - - -void RtpSessionTable::delSession(const std::string & call_id ) +void RtpSessionTable::delSession(const std::string & call_id) { Lock lock(mutex_); @@ -93,9 +79,9 @@ RtpSession& RtpSessionTable::getOrNewSessionUnlocked(const std::string & call_id return *(it->second); is_new = true; - map_.insert(RtpSessionMap::value_type(call_id, new RtpSession())); - it = map_.find(call_id); - return *(it->second); + std::pair ret = map_.insert(RtpSessionMap::value_type(call_id, NULL)); + ret.first->second = new RtpSession(ret.first->first); + return *(ret.first->second); } RtpSession& RtpSessionTable::getSession(const std::string & call_id) -- cgit v1.2.3