[farsight2/master] Lock participant data with participant lock
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:26:28 PST 2008
---
transmitters/nice/fs-nice-stream-transmitter.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index b973d2e..3b14dd2 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -848,9 +848,14 @@ weak_agent_removed (gpointer user_data, GObject *where_the_object_was)
GList *agents = NULL;
FsParticipant *participant = user_data;
+ FS_PARTICIPANT_DATA_LOCK (participant);
+
agents = g_object_get_data (G_OBJECT (participant), "nice-agents");
agents = g_list_remove (agents, where_the_object_was);
g_object_set_data (G_OBJECT (participant), "nice-agents", agents);
+
+ FS_PARTICIPANT_DATA_UNLOCK (participant);
+
g_object_unref (participant);
}
@@ -904,6 +909,8 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
/* First find if there is already a matching agent */
+ FS_PARTICIPANT_DATA_LOCK (participant);
+
agents = g_object_get_data (G_OBJECT (participant), "nice-agents");
for (item = g_list_first (agents);
@@ -990,6 +997,8 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
self->priv->agent = g_object_ref (agent);
}
+ FS_PARTICIPANT_DATA_UNLOCK (participant);
+
self->priv->component_states = g_new0 (FsStreamState,
self->priv->transmitter->components);
--
1.5.6.5
More information about the farsight-commits
mailing list