ext/gnomevfs/gstgnomevfssrc.c (gst_gnomevfssrc_uri_get_protocols): protect gst_gnomevfs_get_supported_uris by a mutex...

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.
This commit is contained in:
Johan Dahlin 2005-10-02 21:06:02 +00:00
parent 721c97d438
commit cbb8f9f637
2 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,9 @@
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)

View file

@ -106,6 +106,7 @@ typedef struct _GstGnomeVFSSrc
gint audiocast_thread_die_outfd;
gint audiocast_port;
gint audiocast_fd;
GMutex *list_uris_mutex;
} GstGnomeVFSSrc;
typedef struct _GstGnomeVFSSrcClass
@ -343,9 +344,16 @@ static gchar **
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;
}