summaryrefslogtreecommitdiff
path: root/agent/inputstream.c
diff options
context:
space:
mode:
authorJuan Navarro <juan.navarro@gmx.es>2018-08-20 18:01:02 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.com>2018-10-28 14:47:32 +0000
commitda41258a21102f63ec5d5b2dc20d303f772eb195 (patch)
treead9165967d92e82b57678e1d9d967bfe9767fa98 /agent/inputstream.c
parent78bdcfad5738d21b200ec283918dfd93e17b3d85 (diff)
downloadlibnice-da41258a21102f63ec5d5b2dc20d303f772eb195.tar.gz
Use per-agent locks and GWeakRefs in callbacks from timeout sources
Work on libnice's bug #1 in Gitlab. This work is composed of multiple merged parts: - "Global lock contention removed" Phabricator D1900: https://phabricator.freedesktop.org/D1900 By @nifigase Opened in GitLab as Merge Request !12 - "agent: properly handle NiceAgent ref in callbacks from timeout sources" Phabricator D1898: https://phabricator.freedesktop.org/D1898 By @mparis This patch was itself based upon a previous version of the work done in D1900. After the switch of hosting, it got lost. On top of these, additions to follow some review comments from @ocrete: - https://phabricator.freedesktop.org/D1900#40412 - https://phabricator.freedesktop.org/D1898#39332
Diffstat (limited to 'agent/inputstream.c')
-rw-r--r--agent/inputstream.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/agent/inputstream.c b/agent/inputstream.c
index 58a4a0d..eafac1b 100644
--- a/agent/inputstream.c
+++ b/agent/inputstream.c
@@ -341,7 +341,7 @@ nice_input_stream_close (GInputStream *stream, GCancellable *cancellable,
if (agent == NULL)
return TRUE;
- agent_lock ();
+ agent_lock (agent);
/* Shut down the read side of the pseudo-TCP stream, if it still exists. */
if (agent_find_component (agent, priv->stream_id, priv->component_id,
@@ -350,7 +350,7 @@ nice_input_stream_close (GInputStream *stream, GCancellable *cancellable,
pseudo_tcp_socket_shutdown (component->tcp, PSEUDO_TCP_SHUTDOWN_RD);
}
- agent_unlock ();
+ agent_unlock (agent);
g_object_unref (agent);
@@ -376,7 +376,7 @@ nice_input_stream_is_readable (GPollableInputStream *stream)
if (agent == NULL)
return FALSE;
- agent_lock ();
+ agent_lock (agent);
if (!agent_find_component (agent, priv->stream_id, priv->component_id,
&_stream, &component)) {
@@ -405,7 +405,7 @@ nice_input_stream_is_readable (GPollableInputStream *stream)
}
done:
- agent_unlock ();
+ agent_unlock (agent);
g_object_unref (agent);