Original commit message from CVS:
* ext/gnomevfs/gstgnomevfssrc.c (gst_gnomevfssrc_uri_get_protocols):
protect gst_gnomevfs_get_supported_uris by a mutex, to make it
MT safe.
+2005-10-02 Johan Dahlin <johan@gnome.org>
+
+ * ext/gnomevfs/gstgnomevfssrc.c (gst_gnomevfssrc_uri_get_protocols):
+ protect gst_gnomevfs_get_supported_uris by a mutex, to make it
+ MT safe.
+
2005-10-02 Andy Wingo <wingo@pobox.com>
* gst-libs/gst/audio/gstringbuffer.c (gst_ring_buffer_clear)
gint audiocast_thread_die_outfd;
gint audiocast_port;
gint audiocast_fd;
+ GMutex *list_uris_mutex;
} GstGnomeVFSSrc;
typedef struct _GstGnomeVFSSrcClass
gst_gnomevfssrc_uri_get_protocols (void)
{
static gchar **protocols = NULL;
+ static GMutex *mutex = NULL;
- if (!protocols)
+ if (G_UNLIKELY (!protocols)) {
+ if (!mutex)
+ mutex = g_mutex_new ();
+
+ g_mutex_lock (mutex);
protocols = gst_gnomevfs_get_supported_uris ();
+ g_mutex_unlock (mutex);
+ }
return protocols;
}