rm boost::mutex from MME

master
Pedro Alvarez 7 years ago
parent 724bc6cbb5
commit 99e1a9f038

@ -29,13 +29,12 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/sctp.h> #include <netinet/sctp.h>
#include <boost/thread/mutex.hpp>
#include "mme/mme.h" #include "mme/mme.h"
namespace srsepc{ namespace srsepc{
mme* mme::m_instance = NULL; mme* mme::m_instance = NULL;
boost::mutex mme_instance_mutex; pthread_mutex_t mme_instance_mutex = PTHREAD_MUTEX_INITIALIZER;
mme::mme(): mme::mme():
m_running(false) m_running(false)
@ -52,21 +51,23 @@ mme::~mme()
mme* mme*
mme::get_instance(void) mme::get_instance(void)
{ {
boost::mutex::scoped_lock lock(mme_instance_mutex); pthread_mutex_lock(&mme_instance_mutex);
if(NULL == m_instance) { if(NULL == m_instance) {
m_instance = new mme(); m_instance = new mme();
} }
pthread_mutex_unlock(&mme_instance_mutex);
return(m_instance); return(m_instance);
} }
void void
mme::cleanup(void) mme::cleanup(void)
{ {
boost::mutex::scoped_lock lock(mme_instance_mutex); pthread_mutex_lock(&mme_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(&mme_instance_mutex);
} }
int int

Loading…
Cancel
Save