mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 06:26:23 +00:00
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:
parent
721c97d438
commit
cbb8f9f637
2 changed files with 15 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue