Commit c7d53105 authored by Aleksander Morgado's avatar Aleksander Morgado

build: remove no longer needed glib version dependent code paths

We require GLib 2.35.x, no need to check for previous versions.
parent e6d88ac6
......@@ -363,14 +363,8 @@ tracker_file_system_has_enough_space (const gchar *path,
enough = (remaining >= required_bytes);
if (creating_db) {
#if GLIB_CHECK_VERSION (2,30,0)
str1 = g_format_size (required_bytes);
str2 = g_format_size (remaining);
#else
str1 = g_format_size_for_display (required_bytes);
str2 = g_format_size_for_display (remaining);
#endif
if (!enough) {
g_critical ("Not enough disk space to create databases, "
......
......@@ -39,11 +39,7 @@ struct _TrackerLanguagePriv {
gboolean enable_stemmer;
gchar *language_code;
#if GLIB_CHECK_VERSION (2,31,0)
GMutex stemmer_mutex;
#else
GMutex *stemmer_mutex;
#endif
gpointer stemmer;
};
......@@ -138,11 +134,7 @@ tracker_language_init (TrackerLanguage *language)
g_str_equal,
g_free,
NULL);
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_init (&priv->stemmer_mutex);
#else
priv->stemmer_mutex = g_mutex_new ();
#endif
stem_language = tracker_language_get_name_by_code (NULL);
priv->stemmer = sb_stemmer_new (stem_language, NULL);
......@@ -155,21 +147,12 @@ language_finalize (GObject *object)
priv = GET_PRIV (object);
#if GLIB_CHECK_VERSION (2,31,0)
if (priv->stemmer) {
g_mutex_lock (&priv->stemmer_mutex);
sb_stemmer_delete (priv->stemmer);
g_mutex_unlock (&priv->stemmer_mutex);
}
g_mutex_clear (&priv->stemmer_mutex);
#else
if (priv->stemmer) {
g_mutex_lock (priv->stemmer_mutex);
sb_stemmer_delete (priv->stemmer);
g_mutex_unlock (priv->stemmer_mutex);
}
g_mutex_free (priv->stemmer_mutex);
#endif
if (priv->stop_words) {
g_hash_table_unref (priv->stop_words);
......@@ -279,11 +262,7 @@ language_add_stopwords (TrackerLanguage *language,
content = g_mapped_file_get_contents (mapped_file);
words = g_strsplit_set (content, "\n" , -1);
#if GLIB_CHECK_VERSION(2,22,0)
g_mapped_file_unref (mapped_file);
#else
g_mapped_file_free (mapped_file);
#endif
/* FIXME: Shouldn't clear the hash table first? */
for (p = words; *p; p++) {
......@@ -326,11 +305,7 @@ language_set_stopword_list (TrackerLanguage *language,
stem_language = tracker_language_get_name_by_code (language_code);
stem_language_lower = g_ascii_strdown (stem_language, -1);
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_lock (&priv->stemmer_mutex);
#else
g_mutex_lock (priv->stemmer_mutex);
#endif
if (priv->stemmer) {
sb_stemmer_delete (priv->stemmer);
......@@ -342,11 +317,7 @@ language_set_stopword_list (TrackerLanguage *language,
stem_language_lower);
}
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_unlock (&priv->stemmer_mutex);
#else
g_mutex_unlock (priv->stemmer_mutex);
#endif
g_free (stem_language_lower);
}
......@@ -542,21 +513,13 @@ tracker_language_stem_word (TrackerLanguage *language,
return g_strndup (word, word_length);
}
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_lock (&priv->stemmer_mutex);
#else
g_mutex_lock (priv->stemmer_mutex);
#endif
stem_word = (const gchar*) sb_stemmer_stem (priv->stemmer,
(guchar*) word,
word_length);
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_unlock (&priv->stemmer_mutex);
#else
g_mutex_unlock (priv->stemmer_mutex);
#endif
return g_strdup (stem_word);
}
......
......@@ -46,11 +46,7 @@ static const gchar *locale_names[TRACKER_LOCALE_LAST] = {
/* Already initialized? */
static gboolean initialized;
#if GLIB_CHECK_VERSION (2,31,0)
static GRecMutex locales_mutex;
#else
static GStaticRecMutex locales_mutex = G_STATIC_REC_MUTEX_INIT;
#endif
const gchar*
tracker_locale_get_name (guint i)
......@@ -63,11 +59,7 @@ void
tracker_locale_set (TrackerLocaleID id,
const gchar *value)
{
#if GLIB_CHECK_VERSION (2,31,0)
g_rec_mutex_lock (&locales_mutex);
#else
g_static_rec_mutex_lock (&locales_mutex);
#endif
if (current_locales[id]) {
g_debug ("Locale '%s' was changed from '%s' to '%s'",
......@@ -107,11 +99,7 @@ tracker_locale_set (TrackerLocaleID id,
break;
}
#if GLIB_CHECK_VERSION (2,31,0)
g_rec_mutex_unlock (&locales_mutex);
#else
g_static_rec_mutex_unlock (&locales_mutex);
#endif
}
void
......@@ -178,21 +166,13 @@ tracker_locale_get (TrackerLocaleID id)
g_return_val_if_fail (initialized, NULL);
#if GLIB_CHECK_VERSION (2,31,0)
g_rec_mutex_lock (&locales_mutex);
#else
g_static_rec_mutex_lock (&locales_mutex);
#endif
/* Always return a duplicated string, as the locale may change at any
* moment */
locale = g_strdup (current_locales[id]);
#if GLIB_CHECK_VERSION (2,31,0)
g_rec_mutex_unlock (&locales_mutex);
#else
g_static_rec_mutex_unlock (&locales_mutex);
#endif
return locale;
}
......
......@@ -39,12 +39,7 @@ static FILE *fd;
static gint verbosity;
static guint log_handler_id;
static gboolean use_log_files;
#if GLIB_CHECK_VERSION (2,31,0)
static GMutex mutex;
#else
static GMutex *mutex;
#endif
static inline void
log_output (const gchar *domain,
......@@ -62,11 +57,7 @@ log_output (const gchar *domain,
g_return_if_fail (message != NULL && message[0] != '\0');
/* Ensure file logging is thread safe */
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_lock (&mutex);
#else
g_mutex_lock (mutex);
#endif
/* Check log size, 10MiB limit */
if (size > (10 << 20) && fd) {
......@@ -133,11 +124,7 @@ log_output (const gchar *domain,
g_free (output);
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_unlock (&mutex);
#else
g_mutex_unlock (mutex);
#endif
}
static void
......@@ -247,11 +234,7 @@ tracker_log_init (gint this_verbosity,
verbosity = CLAMP (this_verbosity, 0, 3);
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_init (&mutex);
#else
mutex = g_mutex_new ();
#endif
switch (this_verbosity) {
/* Log level 3: EVERYTHING */
......@@ -318,11 +301,7 @@ tracker_log_shutdown (void)
fclose (fd);
}
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_clear (&mutex);
#else
g_mutex_free (mutex);
#endif
initialized = FALSE;
}
......@@ -335,13 +335,8 @@ tracker_memory_setrlimits (void)
} else {
gchar *str1, *str2;
#if GLIB_CHECK_VERSION (2,30,0)
str1 = g_format_size (total);
str2 = g_format_size (limit);
#else
str1 = g_format_size_for_display (total);
str2 = g_format_size_for_display (limit);
#endif
g_message ("Setting memory limitations: total is %s, minimum is 256 MB, recommended is ~1 GB", str1);
g_message (" Virtual/Heap set to %s (50%% of total or MAXLONG)", str2);
......
......@@ -52,13 +52,6 @@
#include "tracker-db-interface-sqlite.h"
#include "tracker-db-manager.h"
/* Since 2.30, g_atomic_int_add() is fully equivalente to g_atomic_int_exchange_and_add() */
#if GLIB_CHECK_VERSION (2,30,0)
#define ATOMIC_EXCHANGE_AND_ADD(a,v) g_atomic_int_add (a,v)
#else
#define ATOMIC_EXCHANGE_AND_ADD(a,v) g_atomic_int_exchange_and_add (a,v)
#endif
#define UNKNOWN_STATUS 0.5
typedef struct {
......@@ -1494,7 +1487,7 @@ execute_stmt (TrackerDBInterface *interface,
/* Statement is going to start, check if we got a request to reset the
* collator, and if so, do it. */
if (ATOMIC_EXCHANGE_AND_ADD (&interface->n_active_cursors, 1) == 0 &&
if (g_atomic_int_add (&interface->n_active_cursors, 1) == 0 &&
g_atomic_int_compare_and_exchange (&(interface->collator_reset_requested), TRUE, FALSE)) {
tracker_db_interface_sqlite_reset_collator (interface);
}
......@@ -1871,7 +1864,7 @@ tracker_db_cursor_sqlite_new (sqlite3_stmt *sqlite_stmt,
/* As soon as we create a cursor, check if we need a collator reset
* and notify the iface about the new cursor */
iface = ref_stmt->db_interface;
if (ATOMIC_EXCHANGE_AND_ADD (&iface->n_active_cursors, 1) == 0 &&
if (g_atomic_int_add (&iface->n_active_cursors, 1) == 0 &&
g_atomic_int_compare_and_exchange (&(iface->collator_reset_requested), TRUE, FALSE)) {
tracker_db_interface_sqlite_reset_collator (iface);
}
......
......@@ -120,9 +120,7 @@ static JournalWriter ontology_writer = {0};
static TransactionFormat current_transaction_format;
#if GLIB_CHECK_VERSION (2, 24, 2)
static gboolean tracker_db_journal_rotate (GError **error);
#endif /* GLib check */
static gboolean
journal_eof (JournalReader *jreader)
......@@ -404,7 +402,7 @@ write_all_data (int fd,
while (len > 0) {
written = write (fd, data, len);
if (written < 0) {
gint err = errno;
......@@ -426,7 +424,7 @@ write_all_data (int fd,
return FALSE;
}
len -= written;
data += written;
}
......@@ -1202,13 +1200,11 @@ tracker_db_journal_commit_db_transaction (GError **error)
} else {
ret = db_journal_writer_commit_db_transaction (&writer, &n_error);
#if GLIB_CHECK_VERSION (2, 24, 2)
if (ret) {
if (rotating_settings.do_rotating && (writer.cur_size > rotating_settings.chunk_size)) {
ret = tracker_db_journal_rotate (&n_error);
}
}
#endif /* GLib check */
}
if (n_error) {
......@@ -1290,7 +1286,6 @@ db_journal_reader_init_file (JournalReader *jreader,
const gchar *filename,
GError **error)
{
#if GLIB_CHECK_VERSION (2, 24, 2)
if (g_str_has_suffix (filename, ".gz")) {
GFile *file;
GInputStream *stream, *cstream;
......@@ -1319,7 +1314,6 @@ db_journal_reader_init_file (JournalReader *jreader,
jreader->stream = g_data_input_stream_new (cstream);
g_object_unref (cstream);
} else {
#endif /* GLib check */
jreader->file = g_mapped_file_new (filename, FALSE, error);
if (!jreader->file) {
......@@ -1330,9 +1324,7 @@ db_journal_reader_init_file (JournalReader *jreader,
g_mapped_file_get_contents (jreader->file);
jreader->end = jreader->current + g_mapped_file_get_length (jreader->file);
#if GLIB_CHECK_VERSION (2, 24, 2)
}
#endif /* GLib check */
if (!journal_verify_header (jreader)) {
g_set_error (error, TRACKER_DB_JOURNAL_ERROR,
......@@ -1509,12 +1501,7 @@ db_journal_reader_shutdown (JournalReader *jreader)
jreader->underlying_stream_info = NULL;
}
} else if (jreader->file) {
#if GLIB_CHECK_VERSION(2,22,0)
g_mapped_file_unref (jreader->file);
#else
g_mapped_file_free (jreader->file);
#endif
jreader->file = NULL;
}
......@@ -1579,7 +1566,7 @@ db_journal_reader_next (JournalReader *jreader, gboolean global_reader, GError *
* [magic]
* [version]
* [
* [entry
* [entry
* [size]
* [amount]
* [crc]
......@@ -1884,7 +1871,7 @@ tracker_db_journal_reader_verify_last (const gchar *filename,
if (jreader.end - entry_size_check < jreader.current) {
g_set_error (error, TRACKER_DB_JOURNAL_ERROR,
TRACKER_DB_JOURNAL_ERROR_DAMAGED_JOURNAL_ENTRY,
TRACKER_DB_JOURNAL_ERROR_DAMAGED_JOURNAL_ENTRY,
"Damaged journal entry at end of journal");
db_journal_reader_shutdown (&jreader);
return FALSE;
......@@ -2056,7 +2043,6 @@ tracker_db_journal_reader_get_progress (void)
return ret;
}
#if GLIB_CHECK_VERSION (2, 24, 2)
static void
on_chunk_copied_delete (GObject *source_object,
GAsyncResult *res,
......@@ -2121,7 +2107,7 @@ tracker_db_journal_rotate (GError **error)
ptr = f_name + strlen (TRACKER_DB_JOURNAL_FILENAME ".");
cur = atoi (ptr);
max = MAX (cur, max);
}
}
f_name = g_dir_read_name (journal_dir);
}
......@@ -2185,7 +2171,6 @@ tracker_db_journal_rotate (GError **error)
return ret;
}
#endif /* GLib check */
#else /* DISABLE_JOURNAL */
void
......
......@@ -162,11 +162,7 @@ static TrackerDBManagerFlags old_flags = 0;
static guint s_cache_size;
static guint u_cache_size;
#if GLIB_CHECK_VERSION (2,31,0)
static GPrivate interface_data_key = G_PRIVATE_INIT ((GDestroyNotify)g_object_unref);
#else
static GStaticPrivate interface_data_key = G_STATIC_PRIVATE_INIT;
#endif
/* mutex used by singleton connection in libtracker-direct, not used by tracker-store */
static GMutex global_mutex;
......@@ -1244,13 +1240,8 @@ tracker_db_manager_init (TrackerDBManagerFlags flags,
s_cache_size = select_cache_size;
u_cache_size = update_cache_size;
if ((flags & TRACKER_DB_MANAGER_READONLY) == 0) {
#if GLIB_CHECK_VERSION (2,31,0)
if ((flags & TRACKER_DB_MANAGER_READONLY) == 0)
g_private_replace (&interface_data_key, resources_iface);
#else
g_static_private_set (&interface_data_key, resources_iface, (GDestroyNotify) g_object_unref);
#endif
}
return TRUE;
}
......@@ -1288,11 +1279,7 @@ tracker_db_manager_shutdown (void)
}
/* shutdown db interface in all threads */
#if GLIB_CHECK_VERSION (2,31,0)
g_private_replace (&interface_data_key, NULL);
#else
g_static_private_free (&interface_data_key);
#endif
/* Since we don't reference this enum anywhere, we do
* it here to make sure it exists when we call
......@@ -1502,11 +1489,7 @@ tracker_db_manager_get_db_interface (void)
return global_iface;
}
#if GLIB_CHECK_VERSION (2,31,0)
interface = g_private_get (&interface_data_key);
#else
interface = g_static_private_get (&interface_data_key);
#endif
/* Ensure the interface is there */
if (!interface) {
......@@ -1529,11 +1512,7 @@ tracker_db_manager_get_db_interface (void)
TRACKER_DB_STATEMENT_CACHE_TYPE_UPDATE,
u_cache_size);
#if GLIB_CHECK_VERSION (2,31,0)
g_private_set (&interface_data_key, interface);
#else
g_static_private_set (&interface_data_key, interface, (GDestroyNotify)g_object_unref);
#endif
}
return interface;
......
......@@ -63,12 +63,8 @@ typedef struct {
gboolean service_is_available;
} TrackerThumbnailerPrivate;
#if GLIB_CHECK_VERSION (2,31,0)
static void private_free (gpointer data);
static GPrivate private_key = G_PRIVATE_INIT (private_free);
#else
static GStaticPrivate private_key = G_STATIC_PRIVATE_INIT;
#endif
static void
private_free (gpointer data)
......@@ -146,11 +142,7 @@ tracker_thumbnailer_init (void)
/* Don't start at 0, start at 1. */
private->request_id = 1;
#if GLIB_CHECK_VERSION (2,31,0)
g_private_replace (&private_key, private);
#else
g_static_private_set (&private_key, private, private_free);
#endif
g_message ("Thumbnailer connections being set up...");
......@@ -276,11 +268,7 @@ error_handler:
void
tracker_thumbnailer_shutdown (void)
{
#if GLIB_CHECK_VERSION (2,31,0)
g_private_replace (&private_key, NULL);
#else
g_static_private_set (&private_key, NULL, NULL);
#endif
}
/**
......@@ -309,11 +297,7 @@ tracker_thumbnailer_move_add (const gchar *from_uri,
g_return_val_if_fail (from_uri != NULL, FALSE);
g_return_val_if_fail (to_uri != NULL, FALSE);
#if GLIB_CHECK_VERSION (2,31,0)
private = g_private_get (&private_key);
#else
private = g_static_private_get (&private_key);
#endif
g_return_val_if_fail (private != NULL, FALSE);
if (!private->service_is_available) {
......@@ -356,11 +340,7 @@ tracker_thumbnailer_remove_add (const gchar *uri,
g_return_val_if_fail (uri != NULL, FALSE);
#if GLIB_CHECK_VERSION (2,31,0)
private = g_private_get (&private_key);
#else
private = g_static_private_get (&private_key);
#endif
g_return_val_if_fail (private != NULL, FALSE);
if (!private->service_is_available) {
......@@ -395,11 +375,7 @@ tracker_thumbnailer_cleanup (const gchar *uri_prefix)
g_return_val_if_fail (uri_prefix != NULL, FALSE);
#if GLIB_CHECK_VERSION (2,31,0)
private = g_private_get (&private_key);
#else
private = g_static_private_get (&private_key);
#endif
g_return_val_if_fail (private != NULL, FALSE);
if (!private->service_is_available) {
......@@ -437,11 +413,7 @@ tracker_thumbnailer_send (void)
TrackerThumbnailerPrivate *private;
guint list_len;
#if GLIB_CHECK_VERSION (2,31,0)
private = g_private_get (&private_key);
#else
private = g_static_private_get (&private_key);
#endif
g_return_if_fail (private != NULL);
if (!private->service_is_available) {
......
......@@ -61,13 +61,8 @@ struct TrackerControllerPrivate {
GError *initialization_error;
#if GLIB_CHECK_VERSION (2,31,0)
GCond initialization_cond;
GMutex initialization_mutex;
#else
GCond *initialization_cond;
GMutex *initialization_mutex;
#endif
guint initialized : 1;
};
......@@ -172,13 +167,8 @@ tracker_controller_finalize (GObject *object)
g_main_loop_unref (priv->main_loop);
g_main_context_unref (priv->context);
#if GLIB_CHECK_VERSION (2,31,0)
g_cond_clear (&priv->initialization_cond);
g_mutex_clear (&priv->initialization_mutex);
#else
g_cond_free (priv->initialization_cond);
g_mutex_free (priv->initialization_mutex);
#endif
G_OBJECT_CLASS (tracker_controller_parent_class)->finalize (object);
}
......@@ -411,13 +401,8 @@ tracker_controller_init (TrackerController *controller)
g_signal_connect (priv->storage, "mount-point-removed",
G_CALLBACK (mount_point_removed_cb), controller);
#if GLIB_CHECK_VERSION (2,31,0)
g_cond_init (&priv->initialization_cond);
g_mutex_init (&priv->initialization_mutex);
#else
priv->initialization_cond = g_cond_new ();
priv->initialization_mutex = g_mutex_new ();
#endif
}
static void
......@@ -778,23 +763,14 @@ controller_notify_main_thread (TrackerController *controller,
priv = controller->priv;
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_lock (&priv->initialization_mutex);
#else
g_mutex_lock (priv->initialization_mutex);
#endif
priv->initialized = TRUE;
priv->initialization_error = error;
/* Notify about the initialization */
#if GLIB_CHECK_VERSION (2,31,0)
g_cond_signal (&priv->initialization_cond);
g_mutex_unlock (&priv->initialization_mutex);
#else
g_cond_signal (priv->initialization_cond);
g_mutex_unlock (priv->initialization_mutex);
#endif
}
static void
......@@ -984,8 +960,6 @@ tracker_controller_start (TrackerController *controller,
GError **error)
{
TrackerControllerPrivate *priv;
#if GLIB_CHECK_VERSION (2,31,0)
GThread *thread;
thread = g_thread_try_new ("controller",
......@@ -997,12 +971,6 @@ tracker_controller_start (TrackerController *controller,
/* We don't want to join it, so just unref the GThread */
g_thread_unref (thread);
#else
if (!g_thread_create (tracker_controller_thread_func,
controller, FALSE, error)) {
return FALSE;
}
#endif
priv = controller->priv;
......@@ -1012,18 +980,10 @@ tracker_controller_start (TrackerController *controller,
#endif /* THREAD_ENABLE_TRACE */
/* Wait for the controller thread to notify initialization */
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_lock (&priv->initialization_mutex);
while (!priv->initialized)
g_cond_wait (&priv->initialization_cond, &priv->initialization_mutex);
g_mutex_unlock (&priv->initialization_mutex);
#else
g_mutex_lock (priv->initialization_mutex);
while (!priv->initialized) {
g_cond_wait (priv->initialization_cond, priv->initialization_mutex);
}
g_mutex_unlock (priv->initialization_mutex);
#endif
/* If there was any error resulting from initialization, propagate it */
if (priv->initialization_error != NULL) {
......
......@@ -61,11 +61,7 @@ typedef struct {
/* used to maintain the running tasks
* and stats from different threads
*/
#if GLIB_CHECK_VERSION (2,31,0)
GMutex task_mutex;
#else
GMutex *task_mutex;
#endif
/* Thread pool for multi-threaded extractors */
GThreadPool *thread_pool;
......@@ -144,11 +140,7 @@ tracker_extract_init (TrackerExtract *object)
priv->thread_pool = g_thread_pool_new ((GFunc) get_metadata,
NULL, 10, TRUE, NULL);
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_init (&priv->task_mutex);
#else
priv->task_mutex = g_mutex_new ();
#endif
}
static void
......@@ -173,11 +165,7 @@ tracker_extract_finalize (GObject *object)
g_hash_table_destroy (priv->statistics_data);
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_clear (&priv->task_mutex);
#else
g_mutex_free (priv->task_mutex);
#endif
G_OBJECT_CLASS (tracker_extract_parent_class)->finalize (object);
}
......@@ -191,11 +179,7 @@ report_statistics (GObject *object)
priv = TRACKER_EXTRACT_GET_PRIVATE (object);
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_lock (&priv->task_mutex);
#else
g_mutex_lock (priv->task_mutex);
#endif
g_message ("--------------------------------------------------");
g_message ("Statistics:");
......@@ -228,11 +212,7 @@ report_statistics (GObject *object)
g_message ("--------------------------------------------------");
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_unlock (&priv->task_mutex);
#else
g_mutex_unlock (priv->task_mutex);
#endif
}
TrackerExtract *
......@@ -273,11 +253,7 @@ notify_task_finish (TrackerExtractTask *task,
/* Reports and ongoing tasks may be
* accessed from other threads.
*/
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_lock (&priv->task_mutex);
#else
g_mutex_lock (priv->task_mutex);
#endif
stats_data = g_hash_table_lookup (priv->statistics_data,
task->cur_module);
......@@ -297,11 +273,7 @@ notify_task_finish (TrackerExtractTask *task,
priv->running_tasks = g_list_remove (priv->running_tasks, task);
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_unlock (&priv->task_mutex);
#else
g_mutex_unlock (priv->task_mutex);
#endif
}
static gboolean
......@@ -411,11 +383,7 @@ task_cancellable_cancelled_cb (GCancellable *cancellable,
extract = task->extract;
priv = TRACKER_EXTRACT_GET_PRIVATE (extract);
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_lock (&priv->task_mutex);
#else
g_mutex_lock (priv->task_mutex);
#endif
if (g_list_find (priv->running_tasks, task)) {
g_message ("Cancelled task for '%s' was currently being "
......@@ -424,11 +392,7 @@ task_cancellable_cancelled_cb (GCancellable *cancellable,
_exit (0);
}
#if GLIB_CHECK_VERSION (2,31,0)
g_mutex_unlock (&priv->task_mutex);
#else
g_mutex_unlock (priv->task_mutex);
#endif
}