Removed boost::mutex from EPC

master
Pedro Alvarez 7 years ago
parent aa437806d8
commit 628ccec07f

@ -36,7 +36,7 @@ using namespace srslte;
namespace srsepc{ namespace srsepc{
hss* hss::m_instance = NULL; hss* hss::m_instance = NULL;
boost::mutex hss_instance_mutex; pthread_mutex_t hss_instance_mutex = PTHREAD_MUTEX_INITIALIZER;
hss::hss() hss::hss()
// :m_sqn(0x112233445566) // :m_sqn(0x112233445566)
@ -54,21 +54,23 @@ hss::~hss()
hss* hss*
hss::get_instance(void) hss::get_instance(void)
{ {
boost::mutex::scoped_lock lock(hss_instance_mutex); pthread_mutex_lock(&hss_instance_mutex);
if(NULL == m_instance) { if(NULL == m_instance) {
m_instance = new hss(); m_instance = new hss();
} }
pthread_mutex_unlock(&hss_instance_mutex);
return(m_instance); return(m_instance);
} }
void void
hss::cleanup(void) hss::cleanup(void)
{ {
boost::mutex::scoped_lock lock(hss_instance_mutex); pthread_mutex_lock(&hss_instance_mutex);
if(NULL != m_instance) { if(NULL != m_instance) {
delete m_instance; delete m_instance;
m_instance = NULL; m_instance = NULL;
} }
pthread_mutex_unlock(&hss_instance_mutex);
} }
int int

@ -50,8 +50,8 @@ s1ap_mngmt_proc::get_instance(void)
if(NULL == m_instance) { if(NULL == m_instance) {
m_instance = new s1ap_mngmt_proc(); m_instance = new s1ap_mngmt_proc();
} }
return(m_instance);
pthread_mutex_unlock(&s1ap_mngmt_proc_instance_mutex); pthread_mutex_unlock(&s1ap_mngmt_proc_instance_mutex);
return(m_instance);
} }
void void

@ -41,7 +41,7 @@
namespace srsepc{ namespace srsepc{
spgw* spgw::m_instance = NULL; spgw* spgw::m_instance = NULL;
boost::mutex spgw_instance_mutex; pthread_mutex_t spgw_instance_mutex = PTHREAD_MUTEX_INITIALIZER;
const uint16_t SPGW_BUFFER_SIZE = 2500; const uint16_t SPGW_BUFFER_SIZE = 2500;
@ -63,21 +63,23 @@ spgw::~spgw()
spgw* spgw*
spgw::get_instance(void) spgw::get_instance(void)
{ {
boost::mutex::scoped_lock lock(spgw_instance_mutex); pthread_mutex_lock(&spgw_instance_mutex);
if(NULL == m_instance) { if(NULL == m_instance) {
m_instance = new spgw(); m_instance = new spgw();
} }
pthread_mutex_unlock(&spgw_instance_mutex);
return(m_instance); return(m_instance);
} }
void void
spgw::cleanup(void) spgw::cleanup(void)
{ {
boost::mutex::scoped_lock lock(spgw_instance_mutex); pthread_mutex_lock(&spgw_instance_mutex);
if(NULL != m_instance) { if(NULL != m_instance) {
delete m_instance; delete m_instance;
m_instance = NULL; m_instance = NULL;
} }
pthread_mutex_unlock(&spgw_instance_mutex);
} }
int int

Loading…
Cancel
Save