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

Loading…
Cancel
Save