From 628ccec07f3a2eeb2473c6b24509136f0288e9b9 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 24 Jan 2018 16:41:59 +0000 Subject: [PATCH] Removed boost::mutex from EPC --- srsepc/src/hss/hss.cc | 10 ++++++---- srsepc/src/mme/s1ap_mngmt_proc.cc | 2 +- srsepc/src/spgw/spgw.cc | 8 +++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/srsepc/src/hss/hss.cc b/srsepc/src/hss/hss.cc index 5fc383078..36b47d0e3 100644 --- a/srsepc/src/hss/hss.cc +++ b/srsepc/src/hss/hss.cc @@ -36,7 +36,7 @@ using namespace srslte; namespace srsepc{ hss* hss::m_instance = NULL; -boost::mutex hss_instance_mutex; +pthread_mutex_t hss_instance_mutex = PTHREAD_MUTEX_INITIALIZER; hss::hss() // :m_sqn(0x112233445566) @@ -53,22 +53,24 @@ hss::~hss() hss* hss::get_instance(void) -{ - boost::mutex::scoped_lock lock(hss_instance_mutex); +{ + pthread_mutex_lock(&hss_instance_mutex); if(NULL == m_instance) { m_instance = new hss(); } + pthread_mutex_unlock(&hss_instance_mutex); return(m_instance); } void hss::cleanup(void) { - boost::mutex::scoped_lock lock(hss_instance_mutex); + pthread_mutex_lock(&hss_instance_mutex); if(NULL != m_instance) { delete m_instance; m_instance = NULL; } + pthread_mutex_unlock(&hss_instance_mutex); } int diff --git a/srsepc/src/mme/s1ap_mngmt_proc.cc b/srsepc/src/mme/s1ap_mngmt_proc.cc index 477ce203f..3aa3688e0 100644 --- a/srsepc/src/mme/s1ap_mngmt_proc.cc +++ b/srsepc/src/mme/s1ap_mngmt_proc.cc @@ -50,8 +50,8 @@ s1ap_mngmt_proc::get_instance(void) if(NULL == m_instance) { m_instance = new s1ap_mngmt_proc(); } - return(m_instance); pthread_mutex_unlock(&s1ap_mngmt_proc_instance_mutex); + return(m_instance); } void diff --git a/srsepc/src/spgw/spgw.cc b/srsepc/src/spgw/spgw.cc index 2458a065b..2f0e0e468 100644 --- a/srsepc/src/spgw/spgw.cc +++ b/srsepc/src/spgw/spgw.cc @@ -41,7 +41,7 @@ namespace srsepc{ 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; @@ -63,21 +63,23 @@ spgw::~spgw() spgw* spgw::get_instance(void) { - boost::mutex::scoped_lock lock(spgw_instance_mutex); + pthread_mutex_lock(&spgw_instance_mutex); if(NULL == m_instance) { m_instance = new spgw(); } + pthread_mutex_unlock(&spgw_instance_mutex); return(m_instance); } void spgw::cleanup(void) { - boost::mutex::scoped_lock lock(spgw_instance_mutex); + pthread_mutex_lock(&spgw_instance_mutex); if(NULL != m_instance) { delete m_instance; m_instance = NULL; } + pthread_mutex_unlock(&spgw_instance_mutex); } int