[farsight2/master] Add mutex to nice stream transmitter
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:26:13 PST 2008
---
transmitters/nice/fs-nice-stream-transmitter.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index 04b300c..fd73ff4 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -85,12 +85,18 @@ struct _FsNiceStreamTransmitterPrivate
gboolean compatibility;
gboolean controlling_mode;
+
+ GMutex *mutex;
};
#define FS_NICE_STREAM_TRANSMITTER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_NICE_STREAM_TRANSMITTER, \
FsNiceStreamTransmitterPrivate))
+#define FS_NICE_STREAM_TRANSMITTER_LOCK(o) g_mutex_lock ((o)->priv->mutex)
+#define FS_NICE_STREAM_TRANSMITTER_UNLOCK(o) g_mutex_unlock ((o)->priv->mutex)
+
+
static void fs_nice_stream_transmitter_class_init (FsNiceStreamTransmitterClass *klass);
static void fs_nice_stream_transmitter_init (FsNiceStreamTransmitter *self);
static void fs_nice_stream_transmitter_dispose (GObject *object);
@@ -231,6 +237,8 @@ fs_nice_stream_transmitter_init (FsNiceStreamTransmitter *self)
self->priv = FS_NICE_STREAM_TRANSMITTER_GET_PRIVATE (self);
self->priv->sending = TRUE;
+
+ self->priv->mutex = g_mutex_new ();
}
static void
@@ -256,6 +264,8 @@ fs_nice_stream_transmitter_finalize (GObject *object)
g_free (self->priv->stun_ip);
g_free (self->priv->turn_ip);
+ g_mutex_free (self->priv->mutex);
+
parent_class->finalize (object);
}
--
1.5.6.5
More information about the farsight-commits
mailing list