[Pkg-voip-commits] [janus] 60/163: plugins: use JANUS_MUTEX_INITIALIZER

Jonas Smedegaard dr at jones.dk
Sat Oct 28 01:22:10 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.2.5-1
in repository janus.

commit cc3c338b2efaf3fd60d9aebce0083d836d8bb0f5
Author: Tristan Matthews <tmatth at videolan.org>
Date:   Wed Aug 2 09:01:13 2017 -0400

    plugins: use JANUS_MUTEX_INITIALIZER
---
 plugins/janus_audiobridge.c | 9 +++------
 plugins/janus_echotest.c    | 3 +--
 plugins/janus_recordplay.c  | 6 ++----
 plugins/janus_sip.c         | 3 +--
 plugins/janus_streaming.c   | 8 ++------
 plugins/janus_textroom.c    | 9 +++------
 plugins/janus_videocall.c   | 3 +--
 plugins/janus_videoroom.c   | 9 +++------
 plugins/janus_voicemail.c   | 3 +--
 9 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/plugins/janus_audiobridge.c b/plugins/janus_audiobridge.c
index 00cf23a..6ace4e2 100644
--- a/plugins/janus_audiobridge.c
+++ b/plugins/janus_audiobridge.c
@@ -723,7 +723,7 @@ static struct janus_json_parameter stop_rtp_forward_parameters[] = {
 /* Static configuration instance */
 static janus_config *config = NULL;
 static const char *config_folder = NULL;
-static janus_mutex config_mutex;
+static janus_mutex config_mutex = JANUS_MUTEX_INITIALIZER;
 
 /* Useful stuff */
 static volatile gint initialized = 0, stopping = 0;
@@ -793,7 +793,7 @@ typedef struct janus_audiobridge_room {
 	int rtp_udp_sock;			/* UDP socket to use to forward RTP packets */
 } janus_audiobridge_room;
 static GHashTable *rooms;
-static janus_mutex rooms_mutex;
+static janus_mutex rooms_mutex = JANUS_MUTEX_INITIALIZER;
 static GList *old_rooms;
 static char *admin_key = NULL;
 
@@ -807,7 +807,7 @@ typedef struct janus_audiobridge_session {
 } janus_audiobridge_session;
 static GHashTable *sessions;
 static GList *old_sessions;
-static janus_mutex sessions_mutex;
+static janus_mutex sessions_mutex = JANUS_MUTEX_INITIALIZER;
 
 typedef struct janus_audiobridge_participant {
 	janus_audiobridge_session *session;
@@ -1052,12 +1052,9 @@ int janus_audiobridge_init(janus_callbacks *callback, const char *config_path) {
 	config_folder = config_path;
 	if(config != NULL)
 		janus_config_print(config);
-	janus_mutex_init(&config_mutex);
 	
 	rooms = g_hash_table_new_full(g_int64_hash, g_int64_equal, (GDestroyNotify)g_free, NULL);
-	janus_mutex_init(&rooms_mutex);
 	sessions = g_hash_table_new(NULL, NULL);
-	janus_mutex_init(&sessions_mutex);
 	messages = g_async_queue_new_full((GDestroyNotify) janus_audiobridge_message_free);
 	/* This is the callback we'll need to invoke to contact the gateway */
 	gateway = callback;
diff --git a/plugins/janus_echotest.c b/plugins/janus_echotest.c
index bb0a8fd..2020fbc 100644
--- a/plugins/janus_echotest.c
+++ b/plugins/janus_echotest.c
@@ -206,7 +206,7 @@ typedef struct janus_echotest_session {
 } janus_echotest_session;
 static GHashTable *sessions;
 static GList *old_sessions;
-static janus_mutex sessions_mutex;
+static janus_mutex sessions_mutex = JANUS_MUTEX_INITIALIZER;
 
 static void janus_echotest_message_free(janus_echotest_message *msg) {
 	if(!msg || msg == &exit_message)
@@ -302,7 +302,6 @@ int janus_echotest_init(janus_callbacks *callback, const char *config_path) {
 	config = NULL;
 	
 	sessions = g_hash_table_new(NULL, NULL);
-	janus_mutex_init(&sessions_mutex);
 	messages = g_async_queue_new_full((GDestroyNotify) janus_echotest_message_free);
 	/* This is the callback we'll need to invoke to contact the gateway */
 	gateway = callback;
diff --git a/plugins/janus_recordplay.c b/plugins/janus_recordplay.c
index 19ec3c3..186b228 100644
--- a/plugins/janus_recordplay.c
+++ b/plugins/janus_recordplay.c
@@ -385,7 +385,7 @@ typedef struct janus_recordplay_recording {
 	janus_mutex mutex;	/* Mutex for this recording */
 } janus_recordplay_recording;
 static GHashTable *recordings = NULL;
-static janus_mutex recordings_mutex;
+static janus_mutex recordings_mutex = JANUS_MUTEX_INITIALIZER;
 
 typedef struct janus_recordplay_session {
 	janus_plugin_session *handle;
@@ -410,7 +410,7 @@ typedef struct janus_recordplay_session {
 } janus_recordplay_session;
 static GHashTable *sessions;
 static GList *old_sessions;
-static janus_mutex sessions_mutex;
+static janus_mutex sessions_mutex = JANUS_MUTEX_INITIALIZER;
 
 
 static char *recordings_path = NULL;
@@ -570,11 +570,9 @@ int janus_recordplay_init(janus_callbacks *callback, const char *config_path) {
 		}
 	}
 	recordings = g_hash_table_new_full(g_int64_hash, g_int64_equal, (GDestroyNotify)g_free, NULL);
-	janus_mutex_init(&recordings_mutex);
 	janus_recordplay_update_recordings_list();
 	
 	sessions = g_hash_table_new(NULL, NULL);
-	janus_mutex_init(&sessions_mutex);
 	messages = g_async_queue_new_full((GDestroyNotify) janus_recordplay_message_free);
 	/* This is the callback we'll need to invoke to contact the gateway */
 	gateway = callback;
diff --git a/plugins/janus_sip.c b/plugins/janus_sip.c
index d4efabf..dbb2f43 100644
--- a/plugins/janus_sip.c
+++ b/plugins/janus_sip.c
@@ -374,7 +374,7 @@ static GHashTable *sessions;
 static GList *old_sessions;
 static GHashTable *identities;
 static GHashTable *callids;
-static janus_mutex sessions_mutex;
+static janus_mutex sessions_mutex = JANUS_MUTEX_INITIALIZER;
 
 
 #undef SU_ROOT_MAGIC_T
@@ -865,7 +865,6 @@ int janus_sip_init(janus_callbacks *callback, const char *config_path) {
 	sessions = g_hash_table_new(NULL, NULL);
 	callids = g_hash_table_new(g_str_hash, g_str_equal);
 	identities = g_hash_table_new(g_str_hash, g_str_equal);
-	janus_mutex_init(&sessions_mutex);
 	messages = g_async_queue_new_full((GDestroyNotify) janus_sip_message_free);
 	/* This is the callback we'll need to invoke to contact the gateway */
 	gateway = callback;
diff --git a/plugins/janus_streaming.c b/plugins/janus_streaming.c
index 2ac88ed..c537e2d 100644
--- a/plugins/janus_streaming.c
+++ b/plugins/janus_streaming.c
@@ -331,7 +331,7 @@ static struct janus_json_parameter simulcast_parameters[] = {
 /* Static configuration instance */
 static janus_config *config = NULL;
 static const char *config_folder = NULL;
-static janus_mutex config_mutex;
+static janus_mutex config_mutex = JANUS_MUTEX_INITIALIZER;
 
 /* Useful stuff */
 static volatile gint initialized = 0, stopping = 0;
@@ -527,7 +527,7 @@ typedef struct janus_streaming_session {
 } janus_streaming_session;
 static GHashTable *sessions;
 static GList *old_sessions;
-static janus_mutex sessions_mutex;
+static janus_mutex sessions_mutex = JANUS_MUTEX_INITIALIZER;
 
 /* Packets we get from outside and relay */
 typedef struct janus_streaming_rtp_relay_packet {
@@ -648,10 +648,7 @@ int janus_streaming_init(janus_callbacks *callback, const char *config_path) {
 	if(config != NULL)
 		janus_config_print(config);
 
-	janus_mutex_init(&config_mutex);
-
 	mountpoints = g_hash_table_new_full(g_int64_hash, g_int64_equal, (GDestroyNotify)g_free, NULL);
-	janus_mutex_init(&mountpoints_mutex);
 	/* Parse configuration to populate the mountpoints */
 	if(config != NULL) {
 		/* Any admin key to limit who can "create"? */
@@ -1073,7 +1070,6 @@ int janus_streaming_init(janus_callbacks *callback, const char *config_path) {
 	janus_mutex_unlock(&mountpoints_mutex);
 
 	sessions = g_hash_table_new(NULL, NULL);
-	janus_mutex_init(&sessions_mutex);
 	messages = g_async_queue_new_full((GDestroyNotify) janus_streaming_message_free);
 	/* This is the callback we'll need to invoke to contact the gateway */
 	gateway = callback;
diff --git a/plugins/janus_textroom.c b/plugins/janus_textroom.c
index 704589f..1062d50 100644
--- a/plugins/janus_textroom.c
+++ b/plugins/janus_textroom.c
@@ -185,7 +185,7 @@ static struct janus_json_parameter message_parameters[] = {
 /* Static configuration instance */
 static janus_config *config = NULL;
 static const char *config_folder = NULL;
-static janus_mutex config_mutex;
+static janus_mutex config_mutex = JANUS_MUTEX_INITIALIZER;
 
 /* Useful stuff */
 static volatile gint initialized = 0, stopping = 0;
@@ -240,7 +240,7 @@ typedef struct janus_textroom_room {
 	janus_mutex mutex;			/* Mutex to lock this room instance */
 } janus_textroom_room;
 static GHashTable *rooms;
-static janus_mutex rooms_mutex;
+static janus_mutex rooms_mutex = JANUS_MUTEX_INITIALIZER;
 static GList *old_rooms;
 static char *admin_key = NULL;
 
@@ -254,7 +254,7 @@ typedef struct janus_textroom_session {
 } janus_textroom_session;
 static GHashTable *sessions;
 static GList *old_sessions;
-static janus_mutex sessions_mutex;
+static janus_mutex sessions_mutex = JANUS_MUTEX_INITIALIZER;
 
 typedef struct janus_textroom_participant {
 	janus_textroom_session *session;
@@ -401,13 +401,10 @@ int janus_textroom_init(janus_callbacks *callback, const char *config_path) {
 	config_folder = config_path;
 	if(config != NULL)
 		janus_config_print(config);
-	janus_mutex_init(&config_mutex);
 
 	rooms = g_hash_table_new_full(g_int64_hash, g_int64_equal, (GDestroyNotify)g_free, NULL);
-	janus_mutex_init(&rooms_mutex);
 	sessions = g_hash_table_new(NULL, NULL);
 	messages = g_async_queue_new_full((GDestroyNotify) janus_textroom_message_free);
-	janus_mutex_init(&sessions_mutex);
 	/* This is the callback we'll need to invoke to contact the gateway */
 	gateway = callback;
 
diff --git a/plugins/janus_videocall.c b/plugins/janus_videocall.c
index 53890af..919bd35 100644
--- a/plugins/janus_videocall.c
+++ b/plugins/janus_videocall.c
@@ -383,7 +383,7 @@ typedef struct janus_videocall_session {
 } janus_videocall_session;
 static GHashTable *sessions;
 static GList *old_sessions;
-static janus_mutex sessions_mutex;
+static janus_mutex sessions_mutex = JANUS_MUTEX_INITIALIZER;
 
 
 /* Error codes */
@@ -471,7 +471,6 @@ int janus_videocall_init(janus_callbacks *callback, const char *config_path) {
 	config = NULL;
 	
 	sessions = g_hash_table_new(g_str_hash, g_str_equal);
-	janus_mutex_init(&sessions_mutex);
 	messages = g_async_queue_new_full((GDestroyNotify) janus_videocall_message_free);
 	/* This is the callback we'll need to invoke to contact the gateway */
 	gateway = callback;
diff --git a/plugins/janus_videoroom.c b/plugins/janus_videoroom.c
index ac41c94..f418f31 100644
--- a/plugins/janus_videoroom.c
+++ b/plugins/janus_videoroom.c
@@ -344,7 +344,7 @@ static struct janus_json_parameter listener_parameters[] = {
 /* Static configuration instance */
 static janus_config *config = NULL;
 static const char *config_folder = NULL;
-static janus_mutex config_mutex;
+static janus_mutex config_mutex = JANUS_MUTEX_INITIALIZER;
 
 /* Useful stuff */
 static volatile gint initialized = 0, stopping = 0;
@@ -509,7 +509,7 @@ typedef struct janus_videoroom {
 	janus_mutex participants_mutex;/* Mutex to protect room properties */
 } janus_videoroom;
 static GHashTable *rooms;
-static janus_mutex rooms_mutex;
+static janus_mutex rooms_mutex = JANUS_MUTEX_INITIALIZER;
 static GList *old_rooms;
 static char *admin_key = NULL;
 static void janus_videoroom_free(janus_videoroom *room);
@@ -525,7 +525,7 @@ typedef struct janus_videoroom_session {
 } janus_videoroom_session;
 static GHashTable *sessions;
 static GList *old_sessions;
-static janus_mutex sessions_mutex;
+static janus_mutex sessions_mutex = JANUS_MUTEX_INITIALIZER;
 
 /* A host whose ports gets streamed RTP packets of the corresponding type */
 typedef struct janus_videoroom_rtp_forwarder {
@@ -796,13 +796,10 @@ int janus_videoroom_init(janus_callbacks *callback, const char *config_path) {
 	config_folder = config_path;
 	if(config != NULL)
 		janus_config_print(config);
-	janus_mutex_init(&config_mutex);
 
 	rooms = g_hash_table_new_full(g_int64_hash, g_int64_equal,
 		(GDestroyNotify)g_free, (GDestroyNotify) janus_videoroom_free);
-	janus_mutex_init(&rooms_mutex);
 	sessions = g_hash_table_new(NULL, NULL);
-	janus_mutex_init(&sessions_mutex);
 
 	messages = g_async_queue_new_full((GDestroyNotify) janus_videoroom_message_free);
 
diff --git a/plugins/janus_voicemail.c b/plugins/janus_voicemail.c
index 31b389b..4ccae7c 100644
--- a/plugins/janus_voicemail.c
+++ b/plugins/janus_voicemail.c
@@ -225,7 +225,7 @@ typedef struct janus_voicemail_session {
 } janus_voicemail_session;
 static GHashTable *sessions;
 static GList *old_sessions;
-static janus_mutex sessions_mutex;
+static janus_mutex sessions_mutex = JANUS_MUTEX_INITIALIZER;
 
 static char *recordings_path = NULL;
 static char *recordings_base = NULL;
@@ -324,7 +324,6 @@ int janus_voicemail_init(janus_callbacks *callback, const char *config_path) {
 		janus_config_print(config);
 	
 	sessions = g_hash_table_new(NULL, NULL);
-	janus_mutex_init(&sessions_mutex);
 	messages = g_async_queue_new_full((GDestroyNotify) janus_voicemail_message_free);
 	/* This is the callback we'll need to invoke to contact the gateway */
 	gateway = callback;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git



More information about the Pkg-voip-commits mailing list