globally lock the portrange when trying to grab a port to prep for multithreading
Change-Id: I78ae737b829bb428372f34db7d5bc601b5088b78
diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index b3f2eb5..228b0b3 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -34,6 +34,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <pthread.h>
#include "mgcp_ratectr.h"
@@ -92,6 +93,7 @@
* This holds information on how to allocate ports
*/
struct mgcp_port_range {
+ pthread_mutex_t lock;
/* addr or NULL to fall-back to default */
char *bind_addr_v4;
char *bind_addr_v6;