diff options
author | Alexander Larsson <alexl@redhat.com> | 2007-10-30 16:20:52 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2007-10-30 16:20:52 +0000 |
commit | 815843833a89d3633cef86f2c0effcfbb3b740fb (patch) | |
tree | c14854eb9f96d8545a138a0c377afe6d69727902 /common | |
parent | cdf172a6638a0fe4c5de48e47131386e287d9fea (diff) | |
download | gvfs-815843833a89d3633cef86f2c0effcfbb3b740fb.tar.gz |
Handle threads not being initialized
2007-10-30 Alexander Larsson <alexl@redhat.com>
* common/gmounttracker.c:
Handle threads not being initialized
* daemon/gvfsjobqueryfsinfo.c:
Set volume name
svn path=/trunk/; revision=998
Diffstat (limited to 'common')
-rw-r--r-- | common/gmounttracker.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/common/gmounttracker.c b/common/gmounttracker.c index d1016cf0..87252dab 100644 --- a/common/gmounttracker.c +++ b/common/gmounttracker.c @@ -422,7 +422,8 @@ init_connection (GMountTracker *tracker) static void g_mount_tracker_init (GMountTracker *tracker) { - tracker->lock = g_mutex_new (); + if (g_thread_supported ()) + tracker->lock = g_mutex_new (); } @@ -461,7 +462,8 @@ g_mount_tracker_list_mounts (GMountTracker *tracker) GList *res, *l; GMountInfo *copy; - g_mutex_lock (tracker->lock); + if (tracker->lock) + g_mutex_lock (tracker->lock); res = NULL; for (l = tracker->mounts; l != NULL; l = l->next) @@ -470,7 +472,8 @@ g_mount_tracker_list_mounts (GMountTracker *tracker) res = g_list_prepend (res, copy); } - g_mutex_unlock (tracker->lock); + if (tracker->lock) + g_mutex_unlock (tracker->lock); return g_list_reverse (res); } @@ -482,7 +485,8 @@ g_mount_tracker_find_by_mount_spec (GMountTracker *tracker, GList *l; GMountInfo *info, *found; - g_mutex_lock (tracker->lock); + if (tracker->lock) + g_mutex_lock (tracker->lock); found = NULL; for (l = tracker->mounts; l != NULL; l = l->next) @@ -496,7 +500,8 @@ g_mount_tracker_find_by_mount_spec (GMountTracker *tracker, } } - g_mutex_unlock (tracker->lock); + if (tracker->lock) + g_mutex_unlock (tracker->lock); return found; } @@ -510,7 +515,8 @@ g_mount_tracker_has_mount_spec (GMountTracker *tracker, GMountInfo *info; gboolean found; - g_mutex_lock (tracker->lock); + if (tracker->lock) + g_mutex_lock (tracker->lock); found = FALSE; for (l = tracker->mounts; l != NULL; l = l->next) @@ -524,7 +530,8 @@ g_mount_tracker_has_mount_spec (GMountTracker *tracker, } } - g_mutex_unlock (tracker->lock); + if (tracker->lock) + g_mutex_unlock (tracker->lock); return found; } |