[Pkg-voip-commits] [janus] 61/163: transports: 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 8f249fa915ee7210781b6517534635cfef5a9377
Author: Tristan Matthews <tmatth at videolan.org>
Date:   Wed Aug 2 09:23:43 2017 -0400

    transports: use JANUS_MUTEX_INITIALIZER
---
 transports/janus_http.c       | 3 +--
 transports/janus_pfunix.c     | 3 +--
 transports/janus_websockets.c | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/transports/janus_http.c b/transports/janus_http.c
index 02e5afa..00407e7 100644
--- a/transports/janus_http.c
+++ b/transports/janus_http.c
@@ -125,7 +125,7 @@ typedef struct janus_http_msg {
 	json_t *response;					/* The response from the core */
 } janus_http_msg;
 static GHashTable *messages = NULL;
-static janus_mutex messages_mutex;
+static janus_mutex messages_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 
 /* Helper for long poll: HTTP events to push per session */
@@ -872,7 +872,6 @@ int janus_http_init(janus_transport_callbacks *callback, const char *config_path
 	http_admin_api_enabled = admin_ws || admin_sws;
 
 	messages = g_hash_table_new(NULL, NULL);
-	janus_mutex_init(&messages_mutex);
 	sessions = g_hash_table_new_full(g_int64_hash, g_int64_equal, (GDestroyNotify)g_free, NULL);
 	old_sessions = NULL;
 	janus_mutex_init(&sessions_mutex);
diff --git a/transports/janus_pfunix.c b/transports/janus_pfunix.c
index 6765b83..aca171c 100644
--- a/transports/janus_pfunix.c
+++ b/transports/janus_pfunix.c
@@ -129,7 +129,7 @@ typedef struct janus_pfunix_client {
 	gboolean session_timeout;	/* Whether a Janus session timeout occurred in the core */
 } janus_pfunix_client;
 static GHashTable *clients = NULL, *clients_by_fd = NULL, *clients_by_path = NULL;
-static janus_mutex clients_mutex;
+static janus_mutex clients_mutex = JANUS_MUTEX_INITIALIZER;
 
 
 /* Helper to create a named Unix Socket out of the path to link to */
@@ -289,7 +289,6 @@ int janus_pfunix_init(janus_transport_callbacks *callback, const char *config_pa
 	clients = g_hash_table_new(NULL, NULL);
 	clients_by_fd = g_hash_table_new(NULL, NULL);
 	clients_by_path = g_hash_table_new(g_str_hash, g_str_equal);
-	janus_mutex_init(&clients_mutex);
 
 	/* Start the Unix Sockets service thread */
 	GError *error = NULL;
diff --git a/transports/janus_websockets.c b/transports/janus_websockets.c
index 770a68a..7523c32 100644
--- a/transports/janus_websockets.c
+++ b/transports/janus_websockets.c
@@ -146,7 +146,7 @@ static struct libwebsocket_context *wss = NULL, *swss = NULL,
 #endif
 /* libwebsockets sessions that have been closed */
 static GList *old_wss;
-static janus_mutex old_wss_mutex;
+static janus_mutex old_wss_mutex = JANUS_MUTEX_INITIALIZER;
 /* Callbacks for HTTP-related events (automatically rejected) */
 static int janus_websockets_callback_http(
 #ifdef HAVE_LIBWEBSOCKETS_NEWAPI
@@ -428,7 +428,6 @@ int janus_websockets_init(janus_transport_callbacks *callback, const char *confi
 		JANUS_LOG(LOG_VERB, "libwebsockets logging: %d\n", ws_log_level);
 		lws_set_log_level(ws_log_level, NULL);
 		old_wss = NULL;
-		janus_mutex_init(&old_wss_mutex);
 
 		/* Any ACL for either the Janus or Admin API? */
 		item = janus_config_get_item_drilldown(config, "general", "ws_acl");

-- 
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