[Pkg-telepathy-commits] [libnice] 101/265: outputstream: Release blocking send lock while sending
Simon McVittie
smcv at debian.org
Wed May 14 12:04:57 UTC 2014
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian
in repository libnice.
commit 153bbf6b6ff4000bdf1c615dab63b43771c21e02
Author: Olivier Crête <olivier.crete at collabora.com>
Date: Thu Jan 23 21:37:43 2014 -0500
outputstream: Release blocking send lock while sending
Otherwise it produces a deadlock
---
agent/outputstream.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/agent/outputstream.c b/agent/outputstream.c
index 2025247..9994b66 100644
--- a/agent/outputstream.c
+++ b/agent/outputstream.c
@@ -399,9 +399,16 @@ nice_output_stream_write (GOutputStream *stream, const void *buffer, gsize count
do {
+ /* Have to unlock while calling into the agent because
+ * it will take the agent lock which will cause a deadlock if one of
+ * the callbacks is called.
+ */
+ g_mutex_unlock (&write_data->mutex);
+
_len = nice_agent_send_full (agent, self->priv->stream_id,
self->priv->component_id, (guint8 *) buffer + len, count - len,
cancellable, &child_error);
+ g_mutex_lock (&write_data->mutex);
if (_len == -1 &&
g_error_matches (child_error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/libnice.git
More information about the Pkg-telepathy-commits
mailing list