[evolution-ews] Replace deprecated GLib symbols (as of GLib 2.34.x)
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] Replace deprecated GLib symbols (as of GLib 2.34.x)
- Date: Tue, 6 Nov 2012 16:45:42 +0000 (UTC)
commit a3bd3d25a5736b33c70c2b6c90f22458e7e8a84d
Author: Milan Crha <mcrha redhat com>
Date: Tue Nov 6 17:44:24 2012 +0100
Replace deprecated GLib symbols (as of GLib 2.34.x)
src/addressbook/e-book-backend-ews.c | 49 +++++++--------
src/addressbook/ews-book-backend-sqlitedb-test.c | 3 +
src/addressbook/ews-book-backend-sqlitedb.c | 26 ++++----
src/addressbook/ews-oab-decoder.c | 4 +
src/addressbook/lzx/ews-oal-decompress.c | 4 +
src/calendar/e-cal-backend-ews-utils.c | 2 +
src/calendar/e-cal-backend-ews.c | 10 ++--
src/camel/camel-ews-folder.c | 66 ++++++++++----------
src/camel/camel-ews-private.h | 8 +-
src/camel/camel-ews-store-summary.c | 14 +++--
src/camel/camel-ews-store.c | 48 ++++++++-------
src/collection/e-ews-backend-factory.c | 4 +
src/collection/e-ews-backend.c | 55 +++++++++--------
src/configuration/e-book-config-ews.c | 4 +
src/configuration/e-cal-config-ews.c | 4 +
src/configuration/e-ews-config-utils.c | 9 ++-
src/configuration/e-ews-search-user.c | 5 +-
src/configuration/e-mail-config-ews-autodiscover.c | 5 +-
src/configuration/e-mail-config-ews-backend.c | 5 +-
.../e-mail-config-ews-delegates-page.c | 2 +
src/configuration/e-mail-config-ews-gal.c | 5 +-
src/configuration/e-mail-config-ews-notebook.c | 4 +
.../e-mail-config-ews-oal-combo-box.c | 18 +++--
src/configuration/e-mail-config-ews-ooo-page.c | 25 ++++---
src/server/camel-ews-settings.c | 60 ++++++++++--------
src/server/e-ews-connection.c | 50 ++++++++-------
src/server/e-ews-folder.c | 1 +
src/server/e-ews-item-change.c | 4 +
src/server/e-ews-message.c | 3 +
src/server/e-ews-oof-settings.c | 43 +++++++------
src/server/e-soap-response.c | 4 +
src/server/e-source-ews-folder.c | 34 ++++++-----
src/server/ews-errors.c | 4 +
src/utils/e-ews-query-to-restriction.c | 1 +
src/utils/e-sqlite3-vfs.c | 33 +++++-----
src/utils/ews-test-finditem-query.c | 4 +
36 files changed, 361 insertions(+), 259 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index d3a6f01..ab0fd24 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -20,7 +20,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -59,8 +62,8 @@
static gboolean ebews_fetch_items (EBookBackendEws *ebews, GSList *items, gboolean store_to_cache, GSList **vcards, GCancellable *cancellable, GError **error);
typedef struct {
- GCond *cond;
- GMutex *mutex;
+ GCond cond;
+ GMutex mutex;
gboolean exit;
} SyncDelta;
@@ -83,7 +86,7 @@ struct _EBookBackendEwsPrivate {
/* used for storing attachments */
gchar *attachment_dir;
- GStaticRecMutex rec_mutex;
+ GRecMutex rec_mutex;
GThread *dthread;
SyncDelta *dlock;
@@ -107,8 +110,8 @@ enum {
* some additional properties that are not return with Default view */
#define CONTACT_ITEM_PROPS "item:Attachments item:HasAttachments contacts:Manager contacts:Department contacts:SpouseName contacts:AssistantName contacts:BusinessHomePage contacts:Birthday"
-#define PRIV_LOCK(p) (g_static_rec_mutex_lock (&(p)->rec_mutex))
-#define PRIV_UNLOCK(p) (g_static_rec_mutex_unlock (&(p)->rec_mutex))
+#define PRIV_LOCK(p) (g_rec_mutex_lock (&(p)->rec_mutex))
+#define PRIV_UNLOCK(p) (g_rec_mutex_unlock (&(p)->rec_mutex))
/* Forward Declarations */
static void e_book_backend_ews_authenticator_init
@@ -2365,10 +2368,7 @@ delta_thread (gpointer data)
{
EBookBackendEws *ebews = data;
EBookBackendEwsPrivate *priv = ebews->priv;
- GTimeVal timeout;
-
- timeout.tv_sec = 0;
- timeout.tv_usec = 0;
+ gint64 end_time;
while (TRUE) {
gboolean succeeded;
@@ -2378,22 +2378,21 @@ delta_thread (gpointer data)
else
succeeded = ebews_start_gal_sync (ebews);
- g_mutex_lock (priv->dlock->mutex);
+ g_mutex_lock (&priv->dlock->mutex);
if (!succeeded || priv->dlock->exit)
break;
- g_get_current_time (&timeout);
- g_time_val_add (&timeout, REFRESH_INTERVAL * 1000);
- g_cond_timed_wait (priv->dlock->cond, priv->dlock->mutex, &timeout);
+ end_time = g_get_monotonic_time () + REFRESH_INTERVAL * G_TIME_SPAN_SECOND;
+ g_cond_wait_until (&priv->dlock->cond, &priv->dlock->mutex, end_time);
if (priv->dlock->exit)
break;
- g_mutex_unlock (priv->dlock->mutex);
+ g_mutex_unlock (&priv->dlock->mutex);
}
- g_mutex_unlock (priv->dlock->mutex);
+ g_mutex_unlock (&priv->dlock->mutex);
priv->dthread = NULL;
return NULL;
}
@@ -2410,12 +2409,12 @@ fetch_deltas (EBookBackendEws *ebews)
if (!priv->dlock) {
priv->dlock = g_new0 (SyncDelta, 1);
- priv->dlock->mutex = g_mutex_new ();
- priv->dlock->cond = g_cond_new ();
+ g_mutex_init (&priv->dlock->mutex);
+ g_cond_init (&priv->dlock->cond);
}
priv->dlock->exit = FALSE;
- priv->dthread = g_thread_create ((GThreadFunc) delta_thread, ebews, TRUE, &error);
+ priv->dthread = g_thread_try_new (NULL, (GThreadFunc) delta_thread, ebews, &error);
if (!priv->dthread) {
g_warning (G_STRLOC ": %s", error->message);
g_error_free (error);
@@ -2896,17 +2895,17 @@ e_book_backend_ews_dispose (GObject *object)
}
if (priv->dlock) {
- g_mutex_lock (priv->dlock->mutex);
+ g_mutex_lock (&priv->dlock->mutex);
priv->dlock->exit = TRUE;
- g_mutex_unlock (priv->dlock->mutex);
+ g_mutex_unlock (&priv->dlock->mutex);
- g_cond_signal (priv->dlock->cond);
+ g_cond_signal (&priv->dlock->cond);
if (priv->dthread)
g_thread_join (priv->dthread);
- g_mutex_free (priv->dlock->mutex);
- g_cond_free (priv->dlock->cond);
+ g_mutex_clear (&priv->dlock->mutex);
+ g_cond_clear (&priv->dlock->cond);
g_free (priv->dlock);
priv->dthread = NULL;
}
@@ -2916,7 +2915,7 @@ e_book_backend_ews_dispose (GObject *object)
priv->ebsdb = NULL;
}
- g_static_rec_mutex_free (&priv->rec_mutex);
+ g_rec_mutex_clear (&priv->rec_mutex);
g_free (priv);
priv = NULL;
@@ -3008,7 +3007,7 @@ e_book_backend_ews_init (EBookBackendEws *backend)
priv->ops = g_hash_table_new (NULL, NULL);
bews->priv = priv;
- g_static_rec_mutex_init (&priv->rec_mutex);
+ g_rec_mutex_init (&priv->rec_mutex);
priv->cancellable = g_cancellable_new ();
g_signal_connect (
diff --git a/src/addressbook/ews-book-backend-sqlitedb-test.c b/src/addressbook/ews-book-backend-sqlitedb-test.c
index 2daf937..82fbcb3 100644
--- a/src/addressbook/ews-book-backend-sqlitedb-test.c
+++ b/src/addressbook/ews-book-backend-sqlitedb-test.c
@@ -19,7 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <libebook/libebook.h>
#include "ews-book-backend-sqlitedb.h"
diff --git a/src/addressbook/ews-book-backend-sqlitedb.c b/src/addressbook/ews-book-backend-sqlitedb.c
index 0af6364..bd22b2b 100644
--- a/src/addressbook/ews-book-backend-sqlitedb.c
+++ b/src/addressbook/ews-book-backend-sqlitedb.c
@@ -44,10 +44,10 @@
#define DB_FILENAME "contacts.db"
#define FOLDER_VERSION 1
-#define READER_LOCK(ebsdb) g_static_rw_lock_reader_lock (&ebsdb->priv->rwlock)
-#define READER_UNLOCK(ebsdb) g_static_rw_lock_reader_unlock (&ebsdb->priv->rwlock)
-#define WRITER_LOCK(ebssdb) g_static_rw_lock_writer_lock (&ebsdb->priv->rwlock)
-#define WRITER_UNLOCK(ebssdb) g_static_rw_lock_writer_unlock (&ebsdb->priv->rwlock)
+#define READER_LOCK(ebsdb) g_rw_lock_reader_lock (&ebsdb->priv->rwlock)
+#define READER_UNLOCK(ebsdb) g_rw_lock_reader_unlock (&ebsdb->priv->rwlock)
+#define WRITER_LOCK(ebssdb) g_rw_lock_writer_lock (&ebsdb->priv->rwlock)
+#define WRITER_UNLOCK(ebssdb) g_rw_lock_writer_unlock (&ebsdb->priv->rwlock)
struct _EwsBookBackendSqliteDBPrivate {
sqlite3 *db;
@@ -55,7 +55,7 @@ struct _EwsBookBackendSqliteDBPrivate {
gchar *hash_key;
gboolean store_vcard;
- GStaticRWLock rwlock;
+ GRWLock rwlock;
};
G_DEFINE_TYPE (EwsBookBackendSqliteDB, ews_book_backend_sqlitedb, G_TYPE_OBJECT)
@@ -64,7 +64,7 @@ G_DEFINE_TYPE (EwsBookBackendSqliteDB, ews_book_backend_sqlitedb, G_TYPE_OBJECT)
(ews_book_backend_sqlitedb_error_quark ())
static GHashTable *db_connections = NULL;
-static GStaticMutex dbcon_lock = G_STATIC_MUTEX_INIT;
+static GMutex dbcon_lock;
typedef struct {
EContactField field; /* The EContact field */
@@ -124,7 +124,7 @@ ews_book_backend_sqlitedb_finalize (GObject *object)
priv = EWS_BOOK_BACKEND_SQLITEDB (object)->priv;
- g_static_rw_lock_free (&priv->rwlock);
+ g_rw_lock_clear (&priv->rwlock);
sqlite3_close (priv->db);
priv->db = NULL;
@@ -132,7 +132,7 @@ ews_book_backend_sqlitedb_finalize (GObject *object)
g_free (priv->path);
priv->path = NULL;
- g_static_mutex_lock (&dbcon_lock);
+ g_mutex_lock (&dbcon_lock);
if (db_connections != NULL) {
g_hash_table_remove (db_connections, priv->hash_key);
@@ -144,7 +144,7 @@ ews_book_backend_sqlitedb_finalize (GObject *object)
g_free (priv->hash_key);
priv->hash_key = NULL;
}
- g_static_mutex_unlock (&dbcon_lock);
+ g_mutex_unlock (&dbcon_lock);
g_free (priv);
priv = NULL;
@@ -170,7 +170,7 @@ ews_book_backend_sqlitedb_init (EwsBookBackendSqliteDB *ebsdb)
ebsdb->priv = g_new0 (EwsBookBackendSqliteDBPrivate, 1);
ebsdb->priv->store_vcard = TRUE;
- g_static_rw_lock_init (&ebsdb->priv->rwlock);
+ g_rw_lock_init (&ebsdb->priv->rwlock);
}
static void
@@ -530,7 +530,7 @@ ews_book_backend_sqlitedb_new (const gchar *path,
gchar *hash_key, *filename;
GError *err = NULL;
- g_static_mutex_lock (&dbcon_lock);
+ g_mutex_lock (&dbcon_lock);
hash_key = g_strdup_printf ("%s %s", emailid, path);
if (db_connections != NULL) {
@@ -538,7 +538,7 @@ ews_book_backend_sqlitedb_new (const gchar *path,
if (ebsdb) {
g_object_ref (ebsdb);
- g_static_mutex_unlock (&dbcon_lock);
+ g_mutex_unlock (&dbcon_lock);
g_free (hash_key);
goto exit;
}
@@ -563,7 +563,7 @@ ews_book_backend_sqlitedb_new (const gchar *path,
g_hash_table_insert (db_connections, hash_key, ebsdb);
ebsdb->priv->hash_key = g_strdup (hash_key);
- g_static_mutex_unlock (&dbcon_lock);
+ g_mutex_unlock (&dbcon_lock);
exit:
if (!err)
diff --git a/src/addressbook/ews-oab-decoder.c b/src/addressbook/ews-oab-decoder.c
index 4878333..75c5e41 100644
--- a/src/addressbook/ews-oab-decoder.c
+++ b/src/addressbook/ews-oab-decoder.c
@@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <math.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/addressbook/lzx/ews-oal-decompress.c b/src/addressbook/lzx/ews-oal-decompress.c
index 9a402eb..ec4f683 100644
--- a/src/addressbook/lzx/ews-oal-decompress.c
+++ b/src/addressbook/lzx/ews-oal-decompress.c
@@ -20,6 +20,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/calendar/e-cal-backend-ews-utils.c b/src/calendar/e-cal-backend-ews-utils.c
index 9739a5c..ab3304a 100644
--- a/src/calendar/e-cal-backend-ews-utils.c
+++ b/src/calendar/e-cal-backend-ews-utils.c
@@ -15,7 +15,9 @@
* USA
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <string.h>
#include <sys/types.h>
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index 7c6b873..fc85b52 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -77,7 +77,7 @@ struct _ECalBackendEwsPrivate {
gboolean read_only;
/* A mutex to control access to the private structure for the following */
- GStaticRecMutex rec_mutex;
+ GRecMutex rec_mutex;
icaltimezone *default_zone;
guint refresh_timeout;
guint refreshing;
@@ -97,8 +97,8 @@ struct _SyncItemsClosure {
GSList *items_updated;
};
-#define PRIV_LOCK(p) (g_static_rec_mutex_lock (&(p)->rec_mutex))
-#define PRIV_UNLOCK(p) (g_static_rec_mutex_unlock (&(p)->rec_mutex))
+#define PRIV_LOCK(p) (g_rec_mutex_lock (&(p)->rec_mutex))
+#define PRIV_UNLOCK(p) (g_rec_mutex_unlock (&(p)->rec_mutex))
#define EDC_ERROR(_code) e_data_cal_create_error (_code, NULL)
#define EDC_ERROR_EX(_code, _msg) e_data_cal_create_error (_code, _msg)
@@ -4088,7 +4088,7 @@ e_cal_backend_ews_finalize (GObject *object)
priv = cbews->priv;
/* Clean up */
- g_static_rec_mutex_free (&priv->rec_mutex);
+ g_rec_mutex_clear (&priv->rec_mutex);
if (priv->store) {
g_object_unref (priv->store);
@@ -4294,7 +4294,7 @@ e_cal_backend_ews_init (ECalBackendEws *cbews)
priv = g_new0 (ECalBackendEwsPrivate, 1);
/* create the mutex for thread safety */
- g_static_rec_mutex_init (&priv->rec_mutex);
+ g_rec_mutex_init (&priv->rec_mutex);
priv->refreshing_done = e_flag_new ();
priv->item_id_hash = g_hash_table_new_full
(g_str_hash, g_str_equal,
diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
index 59934b0..6118581 100644
--- a/src/camel/camel-ews-folder.c
+++ b/src/camel/camel-ews-folder.c
@@ -78,14 +78,14 @@ which needs to be better organized via functions */
((obj), CAMEL_TYPE_EWS_FOLDER, CamelEwsFolderPrivate))
struct _CamelEwsFolderPrivate {
- GMutex *search_lock; /* for locking the search object */
- GStaticRecMutex cache_lock; /* for locking the cache object */
+ GMutex search_lock; /* for locking the search object */
+ GRecMutex cache_lock; /* for locking the cache object */
/* For syncronizing refresh_info/sync_changes */
gboolean refreshing;
gboolean fetch_pending;
- GMutex *state_lock;
- GCond *fetch_cond;
+ GMutex state_lock;
+ GCond fetch_cond;
GHashTable *uid_eflags;
};
@@ -178,7 +178,7 @@ camel_ews_folder_get_message_from_cache (CamelEwsFolder *ews_folder,
priv = ews_folder->priv;
- g_static_rec_mutex_lock (&priv->cache_lock);
+ g_rec_mutex_lock (&priv->cache_lock);
stream = ews_data_cache_get (ews_folder->cache, "cur", uid, error);
if (!stream) {
gchar *old_fname = camel_data_cache_get_filename (
@@ -193,7 +193,7 @@ camel_ews_folder_get_message_from_cache (CamelEwsFolder *ews_folder,
}
g_free (old_fname);
if (!stream) {
- g_static_rec_mutex_unlock (&priv->cache_lock);
+ g_rec_mutex_unlock (&priv->cache_lock);
return NULL;
}
}
@@ -206,7 +206,7 @@ camel_ews_folder_get_message_from_cache (CamelEwsFolder *ews_folder,
msg = NULL;
}
- g_static_rec_mutex_unlock (&priv->cache_lock);
+ g_rec_mutex_unlock (&priv->cache_lock);
g_object_unref (stream);
return msg;
@@ -409,7 +409,7 @@ camel_ews_folder_get_message (CamelFolder *folder,
if (!camel_ews_store_connected (ews_store, cancellable, error))
return NULL;
- g_mutex_lock (priv->state_lock);
+ g_mutex_lock (&priv->state_lock);
/* If another thread is already fetching this message, wait for it */
@@ -420,10 +420,10 @@ camel_ews_folder_get_message (CamelFolder *folder,
* falls back to this function. */
if (g_hash_table_lookup (priv->uid_eflags, uid)) {
do {
- g_cond_wait (priv->fetch_cond, priv->state_lock);
+ g_cond_wait (&priv->fetch_cond, &priv->state_lock);
} while (g_hash_table_lookup (priv->uid_eflags, uid));
- g_mutex_unlock (priv->state_lock);
+ g_mutex_unlock (&priv->state_lock);
message = camel_ews_folder_get_message_from_cache (ews_folder, uid, cancellable, error);
return message;
@@ -433,7 +433,7 @@ camel_ews_folder_get_message (CamelFolder *folder,
* we won't be inserting where an entry already exists. So it's
* OK to insert uid itself, not g_strdup (uid) */
g_hash_table_insert (priv->uid_eflags, (gchar *) uid, (gchar *) uid);
- g_mutex_unlock (priv->state_lock);
+ g_mutex_unlock (&priv->state_lock);
cnc = camel_ews_store_ref_connection (ews_store);
ids = g_slist_append (ids, (gchar *) uid);
@@ -545,10 +545,10 @@ camel_ews_folder_get_message (CamelFolder *folder,
message = camel_ews_folder_get_message_from_cache (ews_folder, uid, cancellable, error);
exit:
- g_mutex_lock (priv->state_lock);
+ g_mutex_lock (&priv->state_lock);
g_hash_table_remove (priv->uid_eflags, uid);
- g_mutex_unlock (priv->state_lock);
- g_cond_broadcast (priv->fetch_cond);
+ g_mutex_unlock (&priv->state_lock);
+ g_cond_broadcast (&priv->fetch_cond);
if (!message && !error)
g_set_error (
@@ -608,12 +608,12 @@ ews_folder_search_by_expression (CamelFolder *folder,
ews_folder = CAMEL_EWS_FOLDER (folder);
priv = ews_folder->priv;
- g_mutex_lock (priv->search_lock);
+ g_mutex_lock (&priv->search_lock);
camel_folder_search_set_folder (ews_folder->search, folder);
matches = camel_folder_search_search (ews_folder->search, expression, NULL, cancellable, error);
- g_mutex_unlock (priv->search_lock);
+ g_mutex_unlock (&priv->search_lock);
return matches;
}
@@ -631,12 +631,12 @@ ews_folder_count_by_expression (CamelFolder *folder,
ews_folder = CAMEL_EWS_FOLDER (folder);
priv = ews_folder->priv;
- g_mutex_lock (priv->search_lock);
+ g_mutex_lock (&priv->search_lock);
camel_folder_search_set_folder (ews_folder->search, folder);
matches = camel_folder_search_count (ews_folder->search, expression, cancellable, error);
- g_mutex_unlock (priv->search_lock);
+ g_mutex_unlock (&priv->search_lock);
return matches;
}
@@ -658,12 +658,12 @@ ews_folder_search_by_uids (CamelFolder *folder,
if (uids->len == 0)
return g_ptr_array_new ();
- g_mutex_lock (priv->search_lock);
+ g_mutex_lock (&priv->search_lock);
camel_folder_search_set_folder (ews_folder->search, folder);
matches = camel_folder_search_search (ews_folder->search, expression, uids, cancellable, error);
- g_mutex_unlock (priv->search_lock);
+ g_mutex_unlock (&priv->search_lock);
return matches;
}
@@ -680,11 +680,11 @@ ews_folder_search_free (CamelFolder *folder,
g_return_if_fail (ews_folder->search);
- g_mutex_lock (priv->search_lock);
+ g_mutex_lock (&priv->search_lock);
camel_folder_search_free_result (ews_folder->search, uids);
- g_mutex_unlock (priv->search_lock);
+ g_mutex_unlock (&priv->search_lock);
return;
}
@@ -1395,15 +1395,15 @@ ews_refresh_info_sync (CamelFolder *folder,
if (!camel_ews_store_connected (ews_store, cancellable, error))
return FALSE;
- g_mutex_lock (priv->state_lock);
+ g_mutex_lock (&priv->state_lock);
if (priv->refreshing) {
- g_mutex_unlock (priv->state_lock);
+ g_mutex_unlock (&priv->state_lock);
return TRUE;
}
priv->refreshing = TRUE;
- g_mutex_unlock (priv->state_lock);
+ g_mutex_unlock (&priv->state_lock);
cnc = camel_ews_store_ref_connection (ews_store);
g_return_val_if_fail (cnc != NULL, FALSE);
@@ -1477,9 +1477,9 @@ ews_refresh_info_sync (CamelFolder *folder,
if (local_error)
g_propagate_error (error, local_error);
- g_mutex_lock (priv->state_lock);
+ g_mutex_lock (&priv->state_lock);
priv->refreshing = FALSE;
- g_mutex_unlock (priv->state_lock);
+ g_mutex_unlock (&priv->state_lock);
if (sync_state != ((CamelEwsSummary *) folder->summary)->sync_state)
g_free (sync_state);
g_object_unref (cnc);
@@ -1776,9 +1776,9 @@ ews_folder_dispose (GObject *object)
ews_folder->search = NULL;
}
- g_mutex_free (ews_folder->priv->search_lock);
+ g_mutex_clear (&ews_folder->priv->search_lock);
g_hash_table_destroy (ews_folder->priv->uid_eflags);
- g_cond_free (ews_folder->priv->fetch_cond);
+ g_cond_clear (&ews_folder->priv->fetch_cond);
if (CAMEL_FOLDER (ews_folder)->summary)
g_signal_handlers_disconnect_by_func (CAMEL_FOLDER (ews_folder)->summary, G_CALLBACK (ews_folder_count_notify_cb), ews_folder);
@@ -1864,13 +1864,13 @@ camel_ews_folder_init (CamelEwsFolder *ews_folder)
folder->folder_flags = CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY;
- ews_folder->priv->search_lock = g_mutex_new ();
- ews_folder->priv->state_lock = g_mutex_new ();
- g_static_rec_mutex_init (&ews_folder->priv->cache_lock);
+ g_mutex_init (&ews_folder->priv->search_lock);
+ g_mutex_init (&ews_folder->priv->state_lock);
+ g_rec_mutex_init (&ews_folder->priv->cache_lock);
ews_folder->priv->refreshing = FALSE;
- ews_folder->priv->fetch_cond = g_cond_new ();
+ g_cond_init (&ews_folder->priv->fetch_cond);
ews_folder->priv->uid_eflags = g_hash_table_new (g_str_hash, g_str_equal);
camel_folder_set_lock_async (folder, TRUE);
}
diff --git a/src/camel/camel-ews-private.h b/src/camel/camel-ews-private.h
index baf41a0..d54eb0a 100644
--- a/src/camel/camel-ews-private.h
+++ b/src/camel/camel-ews-private.h
@@ -31,13 +31,13 @@
#ifdef ENABLE_THREADS
#define CAMEL_EWS_FOLDER_LOCK(f, l) \
- (g_static_mutex_lock (&((CamelEwsFolder *) f)->priv->l))
+ (g_mutex_lock (&((CamelEwsFolder *) f)->priv->l))
#define CAMEL_EWS_FOLDER_UNLOCK(f, l) \
- (g_static_mutex_unlock (&((CamelEwsFolder *) f)->priv->l))
+ (g_mutex_unlock (&((CamelEwsFolder *) f)->priv->l))
#define CAMEL_EWS_FOLDER_REC_LOCK(f, l) \
- (g_static_rec_mutex_lock (&((CamelEwsFolder *) f)->priv->l))
+ (g_rec_mutex_lock (&((CamelEwsFolder *) f)->priv->l))
#define CAMEL_EWS_FOLDER_REC_UNLOCK(f, l) \
- (g_static_rec_mutex_unlock (&((CamelEwsFolder *) f)->priv->l))
+ (g_rec_mutex_unlock (&((CamelEwsFolder *) f)->priv->l))
#else
#define CAMEL_EWS_FOLDER_LOCK(f, l)
#define CAMEL_EWS_FOLDER_UNLOCK(f, l)
diff --git a/src/camel/camel-ews-store-summary.c b/src/camel/camel-ews-store-summary.c
index e96fc5d..978fba8 100644
--- a/src/camel/camel-ews-store-summary.c
+++ b/src/camel/camel-ews-store-summary.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <glib.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
@@ -6,8 +10,8 @@
#include "server/e-ews-folder.h"
-#define S_LOCK(x) (g_static_rec_mutex_lock(&(x)->priv->s_lock))
-#define S_UNLOCK(x) (g_static_rec_mutex_unlock(&(x)->priv->s_lock))
+#define S_LOCK(x) (g_rec_mutex_lock(&(x)->priv->s_lock))
+#define S_UNLOCK(x) (g_rec_mutex_unlock(&(x)->priv->s_lock))
#define STORE_GROUP_NAME "##storepriv"
#define CURRENT_SUMMARY_VERSION 1
@@ -21,7 +25,7 @@ struct _CamelEwsStoreSummaryPrivate {
* So entries must always be removed from fname_id_hash *first*. */
GHashTable *id_fname_hash;
GHashTable *fname_id_hash;
- GStaticRecMutex s_lock;
+ GRecMutex s_lock;
GFileMonitor *monitor_delete;
};
@@ -38,7 +42,7 @@ ews_store_summary_finalize (GObject *object)
g_free (priv->path);
g_hash_table_destroy (priv->fname_id_hash);
g_hash_table_destroy (priv->id_fname_hash);
- g_static_rec_mutex_free (&priv->s_lock);
+ g_rec_mutex_clear (&priv->s_lock);
if (priv->monitor_delete)
g_object_unref (priv->monitor_delete);
@@ -72,7 +76,7 @@ camel_ews_store_summary_init (CamelEwsStoreSummary *ews_summary)
g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_free);
- g_static_rec_mutex_init (&priv->s_lock);
+ g_rec_mutex_init (&priv->s_lock);
}
static gchar *build_full_name (CamelEwsStoreSummary *ews_summary, const gchar *fid)
diff --git a/src/camel/camel-ews-store.c b/src/camel/camel-ews-store.c
index 48248da..c9aa5e7 100644
--- a/src/camel/camel-ews-store.c
+++ b/src/camel/camel-ews-store.c
@@ -23,7 +23,9 @@
*
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <errno.h>
#include <stdio.h>
@@ -61,9 +63,9 @@
struct _CamelEwsStorePrivate {
time_t last_refresh_time;
- GMutex *get_finfo_lock;
+ GMutex get_finfo_lock;
EEwsConnection *connection;
- GMutex *connection_lock;
+ GMutex connection_lock;
};
static gboolean ews_store_construct (CamelService *service, CamelSession *session,
@@ -419,7 +421,7 @@ ews_disconnect_sync (CamelService *service,
CamelEwsStore *ews_store = (CamelEwsStore *) service;
CamelServiceClass *service_class;
- g_mutex_lock (ews_store->priv->connection_lock);
+ g_mutex_lock (&ews_store->priv->connection_lock);
/* TODO cancel all operations in the connection */
if (ews_store->priv->connection != NULL) {
@@ -441,7 +443,7 @@ ews_disconnect_sync (CamelService *service,
ews_store->priv->connection = NULL;
}
- g_mutex_unlock (ews_store->priv->connection_lock);
+ g_mutex_unlock (&ews_store->priv->connection_lock);
service_class = CAMEL_SERVICE_CLASS (camel_ews_store_parent_class);
return service_class->disconnect_sync (service, clean, cancellable, error);
@@ -556,23 +558,23 @@ ews_authenticate_sync (CamelService *service,
cancellable, &local_error);
if (local_error == NULL) {
- g_mutex_lock (ews_store->priv->connection_lock);
+ g_mutex_lock (&ews_store->priv->connection_lock);
if (ews_store->priv->connection != NULL)
g_object_unref (ews_store->priv->connection);
ews_store->priv->connection = g_object_ref (connection);
- g_mutex_unlock (ews_store->priv->connection_lock);
+ g_mutex_unlock (&ews_store->priv->connection_lock);
/* This consumes all allocated result data. */
ews_update_folder_hierarchy (
ews_store, sync_state, includes_last_folder,
folders_created, folders_deleted, folders_updated);
} else {
- g_mutex_lock (ews_store->priv->connection_lock);
+ g_mutex_lock (&ews_store->priv->connection_lock);
if (ews_store->priv->connection != NULL) {
g_object_unref (ews_store->priv->connection);
ews_store->priv->connection = NULL;
}
- g_mutex_unlock (ews_store->priv->connection_lock);
+ g_mutex_unlock (&ews_store->priv->connection_lock);
g_free (sync_state);
@@ -768,18 +770,18 @@ ews_folder_hierarchy_ready_cb (GObject *obj,
camel_ews_store_maybe_disconnect (ews_store, error);
- g_mutex_lock (priv->get_finfo_lock);
+ g_mutex_lock (&priv->get_finfo_lock);
ews_store->priv->last_refresh_time -= FINFO_REFRESH_INTERVAL;
- g_mutex_unlock (priv->get_finfo_lock);
+ g_mutex_unlock (&priv->get_finfo_lock);
goto exit;
}
- g_mutex_lock (priv->get_finfo_lock);
+ g_mutex_lock (&priv->get_finfo_lock);
ews_update_folder_hierarchy (
ews_store, sync_state, includes_last_folder,
folders_created, folders_deleted, folders_updated);
ews_store->priv->last_refresh_time = time (NULL);
- g_mutex_unlock (priv->get_finfo_lock);
+ g_mutex_unlock (&priv->get_finfo_lock);
exit:
g_object_unref (ews_store);
@@ -845,11 +847,11 @@ ews_get_folder_info_sync (CamelStore *store,
ews_store = (CamelEwsStore *) store;
priv = ews_store->priv;
- g_mutex_lock (priv->get_finfo_lock);
+ g_mutex_lock (&priv->get_finfo_lock);
if (!(camel_offline_store_get_online (CAMEL_OFFLINE_STORE (store))
&& camel_service_connect_sync ((CamelService *) store, cancellable, error))) {
camel_ews_store_ensure_virtual_folders (ews_store);
- g_mutex_unlock (priv->get_finfo_lock);
+ g_mutex_unlock (&priv->get_finfo_lock);
goto offline;
}
@@ -864,7 +866,7 @@ ews_get_folder_info_sync (CamelStore *store,
if (now - priv->last_refresh_time > FINFO_REFRESH_INTERVAL && ews_refresh_finfo (ews_store))
ews_store->priv->last_refresh_time = time (NULL);
- g_mutex_unlock (priv->get_finfo_lock);
+ g_mutex_unlock (&priv->get_finfo_lock);
goto offline;
}
@@ -889,13 +891,13 @@ ews_get_folder_info_sync (CamelStore *store,
camel_ews_store_maybe_disconnect (ews_store, local_error);
g_propagate_error (error, local_error);
- g_mutex_unlock (priv->get_finfo_lock);
+ g_mutex_unlock (&priv->get_finfo_lock);
return NULL;
}
ews_update_folder_hierarchy (
ews_store, sync_state, includes_last_folder,
folders_created, folders_deleted, folders_updated);
- g_mutex_unlock (priv->get_finfo_lock);
+ g_mutex_unlock (&priv->get_finfo_lock);
offline:
fi = folder_info_from_store_summary ( (CamelEwsStore *) store, top, flags, error);
@@ -1295,12 +1297,12 @@ camel_ews_store_ref_connection (CamelEwsStore *ews_store)
g_return_val_if_fail (CAMEL_IS_EWS_STORE (ews_store), NULL);
- g_mutex_lock (ews_store->priv->connection_lock);
+ g_mutex_lock (&ews_store->priv->connection_lock);
if (ews_store->priv->connection != NULL)
connection = g_object_ref (ews_store->priv->connection);
- g_mutex_unlock (ews_store->priv->connection_lock);
+ g_mutex_unlock (&ews_store->priv->connection_lock);
return connection;
}
@@ -1562,8 +1564,8 @@ ews_store_finalize (GObject *object)
ews_store = CAMEL_EWS_STORE (object);
g_free (ews_store->storage_path);
- g_mutex_free (ews_store->priv->get_finfo_lock);
- g_mutex_free (ews_store->priv->connection_lock);
+ g_mutex_clear (&ews_store->priv->get_finfo_lock);
+ g_mutex_clear (&ews_store->priv->connection_lock);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (camel_ews_store_parent_class)->finalize (object);
@@ -1618,6 +1620,6 @@ camel_ews_store_init (CamelEwsStore *ews_store)
CAMEL_EWS_STORE_GET_PRIVATE (ews_store);
ews_store->priv->last_refresh_time = time (NULL) - (FINFO_REFRESH_INTERVAL + 10);
- ews_store->priv->get_finfo_lock = g_mutex_new ();
- ews_store->priv->connection_lock = g_mutex_new ();
+ g_mutex_init (&ews_store->priv->get_finfo_lock);
+ g_mutex_init (&ews_store->priv->connection_lock);
}
diff --git a/src/collection/e-ews-backend-factory.c b/src/collection/e-ews-backend-factory.c
index 5134003..fbec43b 100644
--- a/src/collection/e-ews-backend-factory.c
+++ b/src/collection/e-ews-backend-factory.c
@@ -16,6 +16,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-ews-backend-factory.h"
#include "e-ews-backend.h"
diff --git a/src/collection/e-ews-backend.c b/src/collection/e-ews-backend.c
index 81f5f0e..aaa0d7f 100644
--- a/src/collection/e-ews-backend.c
+++ b/src/collection/e-ews-backend.c
@@ -16,9 +16,12 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-ews-backend.h"
-#include <config.h>
#include <glib/gi18n-lib.h>
#include "server/e-source-ews-folder.h"
@@ -32,16 +35,16 @@ typedef struct _SyncFoldersClosure SyncFoldersClosure;
struct _EEwsBackendPrivate {
/* Folder ID -> ESource */
GHashTable *folders;
- GMutex *folders_lock;
+ GMutex folders_lock;
ESource *gal_source;
gchar *oal_selected;
gchar *sync_state;
- GMutex *sync_state_lock;
+ GMutex sync_state_lock;
EEwsConnection *connection;
- GMutex *connection_lock;
+ GMutex connection_lock;
gboolean need_update_folders;
};
@@ -89,11 +92,11 @@ ews_backend_folders_contains (EEwsBackend *backend,
g_return_val_if_fail (folder_id != NULL, FALSE);
- g_mutex_lock (backend->priv->folders_lock);
+ g_mutex_lock (&backend->priv->folders_lock);
contains = g_hash_table_contains (backend->priv->folders, folder_id);
- g_mutex_unlock (backend->priv->folders_lock);
+ g_mutex_unlock (&backend->priv->folders_lock);
return contains;
}
@@ -106,14 +109,14 @@ ews_backend_folders_insert (EEwsBackend *backend,
g_return_if_fail (folder_id != NULL);
g_return_if_fail (E_IS_SOURCE (source));
- g_mutex_lock (backend->priv->folders_lock);
+ g_mutex_lock (&backend->priv->folders_lock);
g_hash_table_insert (
backend->priv->folders,
g_strdup (folder_id),
g_object_ref (source));
- g_mutex_unlock (backend->priv->folders_lock);
+ g_mutex_unlock (&backend->priv->folders_lock);
}
static ESource *
@@ -124,14 +127,14 @@ ews_backend_folders_lookup (EEwsBackend *backend,
g_return_val_if_fail (folder_id != NULL, NULL);
- g_mutex_lock (backend->priv->folders_lock);
+ g_mutex_lock (&backend->priv->folders_lock);
source = g_hash_table_lookup (backend->priv->folders, folder_id);
if (source != NULL)
g_object_ref (source);
- g_mutex_unlock (backend->priv->folders_lock);
+ g_mutex_unlock (&backend->priv->folders_lock);
return source;
}
@@ -144,11 +147,11 @@ ews_backend_folders_remove (EEwsBackend *backend,
g_return_val_if_fail (folder_id != NULL, FALSE);
- g_mutex_lock (backend->priv->folders_lock);
+ g_mutex_lock (&backend->priv->folders_lock);
removed = g_hash_table_remove (backend->priv->folders, folder_id);
- g_mutex_unlock (backend->priv->folders_lock);
+ g_mutex_unlock (&backend->priv->folders_lock);
return removed;
}
@@ -554,14 +557,14 @@ ews_backend_finalize (GObject *object)
priv = E_EWS_BACKEND_GET_PRIVATE (object);
g_hash_table_destroy (priv->folders);
- g_mutex_free (priv->folders_lock);
+ g_mutex_clear (&priv->folders_lock);
g_free (priv->oal_selected);
g_free (priv->sync_state);
- g_mutex_free (priv->sync_state_lock);
+ g_mutex_clear (&priv->sync_state_lock);
- g_mutex_free (priv->connection_lock);
+ g_mutex_clear (&priv->connection_lock);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_ews_backend_parent_class)->finalize (object);
@@ -939,9 +942,9 @@ e_ews_backend_init (EEwsBackend *backend)
(GDestroyNotify) g_free,
(GDestroyNotify) g_object_unref);
- backend->priv->folders_lock = g_mutex_new ();
- backend->priv->sync_state_lock = g_mutex_new ();
- backend->priv->connection_lock = g_mutex_new ();
+ g_mutex_init (&backend->priv->folders_lock);
+ g_mutex_init (&backend->priv->sync_state_lock);
+ g_mutex_init (&backend->priv->connection_lock);
}
void
@@ -989,10 +992,10 @@ e_ews_backend_ref_connection_sync (EEwsBackend *backend,
g_return_val_if_fail (E_IS_EWS_BACKEND (backend), NULL);
- g_mutex_lock (backend->priv->connection_lock);
+ g_mutex_lock (&backend->priv->connection_lock);
if (backend->priv->connection != NULL)
connection = g_object_ref (backend->priv->connection);
- g_mutex_unlock (backend->priv->connection_lock);
+ g_mutex_unlock (&backend->priv->connection_lock);
/* If we already have an authenticated
* connection object, just return that. */
@@ -1010,11 +1013,11 @@ e_ews_backend_ref_connection_sync (EEwsBackend *backend,
cancellable, error);
if (success) {
- g_mutex_lock (backend->priv->connection_lock);
+ g_mutex_lock (&backend->priv->connection_lock);
if (backend->priv->connection != NULL)
g_object_unref (backend->priv->connection);
backend->priv->connection = g_object_ref (connection);
- g_mutex_unlock (backend->priv->connection_lock);
+ g_mutex_unlock (&backend->priv->connection_lock);
} else {
g_object_unref (connection);
connection = NULL;
@@ -1107,9 +1110,9 @@ e_ews_backend_sync_folders_sync (EEwsBackend *backend,
backend->priv->need_update_folders = FALSE;
- g_mutex_lock (backend->priv->sync_state_lock);
+ g_mutex_lock (&backend->priv->sync_state_lock);
sync_state = g_strdup (backend->priv->sync_state);
- g_mutex_unlock (backend->priv->sync_state_lock);
+ g_mutex_unlock (&backend->priv->sync_state_lock);
/* XXX I think this leaks the old sync_state value when
* it replaces it with the new sync_state value. */
@@ -1135,10 +1138,10 @@ e_ews_backend_sync_folders_sync (EEwsBackend *backend,
ews_backend_sync_folders_idle_cb, closure,
(GDestroyNotify) sync_folders_closure_free);
- g_mutex_lock (backend->priv->sync_state_lock);
+ g_mutex_lock (&backend->priv->sync_state_lock);
g_free (backend->priv->sync_state);
backend->priv->sync_state = g_strdup (sync_state);
- g_mutex_unlock (backend->priv->sync_state_lock);
+ g_mutex_unlock (&backend->priv->sync_state_lock);
} else {
/* Make sure we're not leaking anything. */
diff --git a/src/configuration/e-book-config-ews.c b/src/configuration/e-book-config-ews.c
index 396c1ec..ec35c56 100644
--- a/src/configuration/e-book-config-ews.c
+++ b/src/configuration/e-book-config-ews.c
@@ -16,6 +16,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-book-config-ews.h"
#include <misc/e-book-source-config.h>
diff --git a/src/configuration/e-cal-config-ews.c b/src/configuration/e-cal-config-ews.c
index 4b85f24..084bd46 100644
--- a/src/configuration/e-cal-config-ews.c
+++ b/src/configuration/e-cal-config-ews.c
@@ -16,6 +16,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-cal-config-ews.h"
#include <misc/e-cal-source-config.h>
diff --git a/src/configuration/e-ews-config-utils.c b/src/configuration/e-ews-config-utils.c
index 35cad33..94de358 100644
--- a/src/configuration/e-ews-config-utils.c
+++ b/src/configuration/e-ews-config-utils.c
@@ -205,20 +205,25 @@ e_ews_config_utils_run_in_thread_with_feedback_general (GtkWindow *parent,
g_signal_connect (dialog, "response", G_CALLBACK (run_with_feedback_response_cb), rfd);
if (run_modal) {
+ GThread *thread;
GCancellable *cancellable;
cancellable = g_object_ref (rfd->cancellable);
- g_return_if_fail (g_thread_create (run_with_feedback_thread, rfd, FALSE, NULL));
+ thread = g_thread_new (NULL, run_with_feedback_thread, rfd);
+ g_thread_unref (thread);
gtk_dialog_run (GTK_DIALOG (dialog));
g_cancellable_cancel (cancellable);
g_object_unref (cancellable);
} else {
+ GThread *thread;
+
gtk_widget_show (dialog);
- g_return_if_fail (g_thread_create (run_with_feedback_thread, rfd, FALSE, NULL));
+ thread = g_thread_new (NULL, run_with_feedback_thread, rfd);
+ g_thread_unref (thread);
}
}
diff --git a/src/configuration/e-ews-search-user.c b/src/configuration/e-ews-search-user.c
index 0246959..157a233 100644
--- a/src/configuration/e-ews-search-user.c
+++ b/src/configuration/e-ews-search-user.c
@@ -293,6 +293,7 @@ schedule_search_cb (gpointer user_data)
if (!g_cancellable_is_cancelled (sid->cancellable)) {
struct EEwsSearchUserData *pgu;
+ GThread *thread;
GError *error = NULL;
pgu = g_object_get_data (sid->dialog, E_EWS_SEARCH_DLG_DATA);
@@ -303,8 +304,10 @@ schedule_search_cb (gpointer user_data)
sid->conn = g_object_ref (pgu->conn);
sid->search_text = g_strdup (pgu->search_text);
- if (g_thread_create (search_thread, sid, FALSE, &error)) {
+ thread = g_thread_try_new (NULL, search_thread, sid, &error);
+ if (thread) {
sid = NULL;
+ g_thread_unref (thread);
} else {
g_object_unref (sid->conn);
g_warning ("%s: Failed to create search thread: %s", G_STRFUNC, error ? error->message : "Unknown error");
diff --git a/src/configuration/e-mail-config-ews-autodiscover.c b/src/configuration/e-mail-config-ews-autodiscover.c
index c1cdcd5..b396d4d 100644
--- a/src/configuration/e-mail-config-ews-autodiscover.c
+++ b/src/configuration/e-mail-config-ews-autodiscover.c
@@ -16,9 +16,12 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-mail-config-ews-autodiscover.h"
-#include <config.h>
#include <glib/gi18n-lib.h>
#include <mail/e-mail-config-service-page.h>
diff --git a/src/configuration/e-mail-config-ews-backend.c b/src/configuration/e-mail-config-ews-backend.c
index 24dda21..b3eb40e 100644
--- a/src/configuration/e-mail-config-ews-backend.c
+++ b/src/configuration/e-mail-config-ews-backend.c
@@ -16,9 +16,12 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-mail-config-ews-backend.h"
-#include <config.h>
#include <glib/gi18n-lib.h>
#include <camel/camel.h>
diff --git a/src/configuration/e-mail-config-ews-delegates-page.c b/src/configuration/e-mail-config-ews-delegates-page.c
index d4b71b8..f8ba3eb 100644
--- a/src/configuration/e-mail-config-ews-delegates-page.c
+++ b/src/configuration/e-mail-config-ews-delegates-page.c
@@ -16,7 +16,9 @@
*
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <string.h>
#include <unistd.h>
diff --git a/src/configuration/e-mail-config-ews-gal.c b/src/configuration/e-mail-config-ews-gal.c
index 5204842..cfd9a7f 100644
--- a/src/configuration/e-mail-config-ews-gal.c
+++ b/src/configuration/e-mail-config-ews-gal.c
@@ -16,9 +16,12 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-mail-config-ews-gal.h"
-#include <config.h>
#include <glib/gi18n-lib.h>
#include <mail/e-mail-config-provider-page.h>
diff --git a/src/configuration/e-mail-config-ews-notebook.c b/src/configuration/e-mail-config-ews-notebook.c
index 012a0b5..3f71a7a 100644
--- a/src/configuration/e-mail-config-ews-notebook.c
+++ b/src/configuration/e-mail-config-ews-notebook.c
@@ -16,6 +16,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-mail-config-ews-notebook.h"
#include <mail/e-mail-config-notebook.h>
diff --git a/src/configuration/e-mail-config-ews-oal-combo-box.c b/src/configuration/e-mail-config-ews-oal-combo-box.c
index 2eb06ae..7a03275 100644
--- a/src/configuration/e-mail-config-ews-oal-combo-box.c
+++ b/src/configuration/e-mail-config-ews-oal-combo-box.c
@@ -16,6 +16,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-mail-config-ews-oal-combo-box.h"
#include <mail/e-mail-config-service-page.h>
@@ -34,7 +38,7 @@ struct _EMailConfigEwsOalComboBoxPrivate {
* the combo box. This avoids calling GTK+ functions from
* multiple threads. */
GSList *oal_items;
- GMutex *oal_items_lock;
+ GMutex oal_items_lock;
};
enum {
@@ -124,7 +128,7 @@ mail_config_ews_oal_combo_box_finalize (GObject *object)
priv = E_MAIL_CONFIG_EWS_OAL_COMBO_BOX_GET_PRIVATE (object);
- g_mutex_free (priv->oal_items_lock);
+ g_mutex_clear (&priv->oal_items_lock);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_mail_config_ews_oal_combo_box_parent_class)->
@@ -167,12 +171,12 @@ mail_config_ews_oal_combo_box_try_password_sync (ESourceAuthenticator *auth,
/* Deposit results in the private struct for
* the update_finish() function to pick up. */
- g_mutex_lock (combo_box->priv->oal_items_lock);
+ g_mutex_lock (&combo_box->priv->oal_items_lock);
g_slist_free_full (
combo_box->priv->oal_items,
(GDestroyNotify) ews_oal_free);
combo_box->priv->oal_items = oal_items;
- g_mutex_unlock (combo_box->priv->oal_items_lock);
+ g_mutex_unlock (&combo_box->priv->oal_items_lock);
} else if (g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_UNAUTHORIZED)) {
result = E_SOURCE_AUTHENTICATION_REJECTED;
@@ -230,7 +234,7 @@ e_mail_config_ews_oal_combo_box_init (EMailConfigEwsOalComboBox *combo_box)
combo_box->priv =
E_MAIL_CONFIG_EWS_OAL_COMBO_BOX_GET_PRIVATE (combo_box);
- combo_box->priv->oal_items_lock = g_mutex_new ();
+ g_mutex_init (&combo_box->priv->oal_items_lock);
}
void
@@ -336,10 +340,10 @@ e_mail_config_ews_oal_combo_box_update_finish (EMailConfigEwsOalComboBox *combo_
/* Re-populate the combo box using the cached results. */
- g_mutex_lock (combo_box->priv->oal_items_lock);
+ g_mutex_lock (&combo_box->priv->oal_items_lock);
list = combo_box->priv->oal_items;
combo_box->priv->oal_items = NULL;
- g_mutex_unlock (combo_box->priv->oal_items_lock);
+ g_mutex_unlock (&combo_box->priv->oal_items_lock);
active_id = g_strdup (gtk_combo_box_get_active_id (GTK_COMBO_BOX (combo_box)));
combo_box_text = GTK_COMBO_BOX_TEXT (combo_box);
diff --git a/src/configuration/e-mail-config-ews-ooo-page.c b/src/configuration/e-mail-config-ews-ooo-page.c
index 0103cda..26e9c22 100644
--- a/src/configuration/e-mail-config-ews-ooo-page.c
+++ b/src/configuration/e-mail-config-ews-ooo-page.c
@@ -16,9 +16,12 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-mail-config-ews-ooo-page.h"
-#include <config.h>
#include <string.h>
#include <unistd.h>
@@ -51,7 +54,7 @@ struct _EMailConfigEwsOooPagePrivate {
/* The try_password() method deposits results here.
* This avoids calling GTK+ functions from multiple threads. */
EEwsOofSettings *oof_settings;
- GMutex *oof_settings_lock;
+ GMutex oof_settings_lock;
/* to not save unchanged state */
gboolean changed;
@@ -242,13 +245,13 @@ mail_config_ews_ooo_page_refresh_cb (GObject *source_object,
} else {
EMailConfigEwsOooPage *page = async_context->page;
- g_mutex_lock (page->priv->oof_settings_lock);
+ g_mutex_lock (&page->priv->oof_settings_lock);
if (page->priv->oof_settings != NULL)
mail_config_ews_ooo_page_display_settings (
page, page->priv->oof_settings);
- g_mutex_unlock (page->priv->oof_settings_lock);
+ g_mutex_unlock (&page->priv->oof_settings_lock);
}
async_context_free (async_context);
@@ -412,7 +415,7 @@ mail_config_ews_ooo_page_finalize (GObject *object)
priv = E_MAIL_CONFIG_EWS_OOO_PAGE_GET_PRIVATE (object);
- g_mutex_free (priv->oof_settings_lock);
+ g_mutex_clear (&priv->oof_settings_lock);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_mail_config_ews_ooo_page_parent_class)->
@@ -701,13 +704,13 @@ mail_config_ews_ooo_page_submit (EMailConfigPage *page,
priv = E_MAIL_CONFIG_EWS_OOO_PAGE_GET_PRIVATE (page);
- g_mutex_lock (priv->oof_settings_lock);
+ g_mutex_lock (&priv->oof_settings_lock);
/* It may be that the Out of Office settings are still
* loading or have failed to load, in which case there
* are obviously no changes to submit. */
if (priv->oof_settings == NULL) {
- g_mutex_unlock (priv->oof_settings_lock);
+ g_mutex_unlock (&priv->oof_settings_lock);
simple = g_simple_async_result_new (
G_OBJECT (page), callback, user_data,
@@ -781,7 +784,7 @@ mail_config_ews_ooo_page_submit (EMailConfigPage *page,
g_object_unref (simple);
- g_mutex_unlock (priv->oof_settings_lock);
+ g_mutex_unlock (&priv->oof_settings_lock);
}
static gboolean
@@ -840,12 +843,12 @@ mail_config_ews_ooo_page_try_password_sync (ESourceAuthenticator *auth,
g_warn_if_fail (local_error == NULL);
/* The page takes ownership of the settings. */
- g_mutex_lock (page->priv->oof_settings_lock);
+ g_mutex_lock (&page->priv->oof_settings_lock);
if (page->priv->oof_settings != NULL)
g_object_unref (oof_settings);
page->priv->oof_settings = oof_settings;
page->priv->changed = FALSE;
- g_mutex_unlock (page->priv->oof_settings_lock);
+ g_mutex_unlock (&page->priv->oof_settings_lock);
} else if (g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_UNAUTHORIZED)) {
result = E_SOURCE_AUTHENTICATION_REJECTED;
@@ -945,7 +948,7 @@ e_mail_config_ews_ooo_page_init (EMailConfigEwsOooPage *page)
{
page->priv = E_MAIL_CONFIG_EWS_OOO_PAGE_GET_PRIVATE (page);
- page->priv->oof_settings_lock = g_mutex_new ();
+ g_mutex_init (&page->priv->oof_settings_lock);
}
void
diff --git a/src/server/camel-ews-settings.c b/src/server/camel-ews-settings.c
index caadc14..67d200e 100644
--- a/src/server/camel-ews-settings.c
+++ b/src/server/camel-ews-settings.c
@@ -16,6 +16,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "camel-ews-settings.h"
#include <libedataserver/libedataserver.h>
@@ -25,7 +29,7 @@
((obj), CAMEL_TYPE_EWS_SETTINGS, CamelEwsSettingsPrivate))
struct _CamelEwsSettingsPrivate {
- GMutex *property_lock;
+ GMutex property_lock;
gboolean check_all;
gboolean filter_junk;
gboolean filter_junk_inbox;
@@ -288,7 +292,7 @@ ews_settings_finalize (GObject *object)
priv = CAMEL_EWS_SETTINGS_GET_PRIVATE (object);
- g_mutex_free (priv->property_lock);
+ g_mutex_clear (&priv->property_lock);
g_free (priv->email);
g_free (priv->gal_uid);
@@ -467,7 +471,7 @@ static void
camel_ews_settings_init (CamelEwsSettings *settings)
{
settings->priv = CAMEL_EWS_SETTINGS_GET_PRIVATE (settings);
- settings->priv->property_lock = g_mutex_new ();
+ g_mutex_init (&settings->priv->property_lock);
}
/**
@@ -527,12 +531,12 @@ camel_ews_settings_dup_email (CamelEwsSettings *settings)
g_return_val_if_fail (CAMEL_IS_EWS_SETTINGS (settings), NULL);
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
protected = camel_ews_settings_get_email (settings);
duplicate = g_strdup (protected);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return duplicate;
}
@@ -543,17 +547,17 @@ camel_ews_settings_set_email (CamelEwsSettings *settings,
{
g_return_if_fail (CAMEL_IS_EWS_SETTINGS (settings));
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
if (g_strcmp0 (settings->priv->email, email) == 0) {
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return;
}
g_free (settings->priv->email);
settings->priv->email = e_util_strdup_strip (email);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
g_object_notify (G_OBJECT (settings), "email");
}
@@ -660,12 +664,12 @@ camel_ews_settings_dup_gal_uid (CamelEwsSettings *settings)
g_return_val_if_fail (CAMEL_IS_EWS_SETTINGS (settings), NULL);
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
protected = camel_ews_settings_get_gal_uid (settings);
duplicate = g_strdup (protected);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return duplicate;
}
@@ -676,17 +680,17 @@ camel_ews_settings_set_gal_uid (CamelEwsSettings *settings,
{
g_return_if_fail (CAMEL_IS_EWS_SETTINGS (settings));
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
if (g_strcmp0 (settings->priv->gal_uid, gal_uid) == 0) {
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return;
}
g_free (settings->priv->gal_uid);
settings->priv->gal_uid = e_util_strdup_strip (gal_uid);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
g_object_notify (G_OBJECT (settings), "gal-uid");
}
@@ -707,12 +711,12 @@ camel_ews_settings_dup_hosturl (CamelEwsSettings *settings)
g_return_val_if_fail (CAMEL_IS_EWS_SETTINGS (settings), NULL);
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
protected = camel_ews_settings_get_hosturl (settings);
duplicate = g_strdup (protected);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return duplicate;
}
@@ -723,17 +727,17 @@ camel_ews_settings_set_hosturl (CamelEwsSettings *settings,
{
g_return_if_fail (CAMEL_IS_EWS_SETTINGS (settings));
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
if (g_strcmp0 (settings->priv->hosturl, hosturl) == 0) {
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return;
}
g_free (settings->priv->hosturl);
settings->priv->hosturl = e_util_strdup_strip (hosturl);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
g_object_notify (G_OBJECT (settings), "hosturl");
}
@@ -754,12 +758,12 @@ camel_ews_settings_dup_oaburl (CamelEwsSettings *settings)
g_return_val_if_fail (CAMEL_IS_EWS_SETTINGS (settings), NULL);
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
protected = camel_ews_settings_get_oaburl (settings);
duplicate = g_strdup (protected);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return duplicate;
}
@@ -770,17 +774,17 @@ camel_ews_settings_set_oaburl (CamelEwsSettings *settings,
{
g_return_if_fail (CAMEL_IS_EWS_SETTINGS (settings));
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
if (g_strcmp0 (settings->priv->oaburl, oaburl) == 0) {
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return;
}
g_free (settings->priv->oaburl);
settings->priv->oaburl = e_util_strdup_strip (oaburl);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
g_object_notify (G_OBJECT (settings), "oaburl");
}
@@ -823,12 +827,12 @@ camel_ews_settings_dup_oal_selected (CamelEwsSettings *settings)
g_return_val_if_fail (CAMEL_IS_EWS_SETTINGS (settings), NULL);
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
protected = camel_ews_settings_get_oal_selected (settings);
duplicate = g_strdup (protected);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return duplicate;
}
@@ -839,17 +843,17 @@ camel_ews_settings_set_oal_selected (CamelEwsSettings *settings,
{
g_return_if_fail (CAMEL_IS_EWS_SETTINGS (settings));
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
if (g_strcmp0 (settings->priv->oal_selected, oal_selected) == 0) {
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return;
}
g_free (settings->priv->oal_selected);
settings->priv->oal_selected = e_util_strdup_strip (oal_selected);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
g_object_notify (G_OBJECT (settings), "oal-selected");
}
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index a31d78f..7b3f1f4 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -22,6 +22,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -48,14 +49,14 @@
/* For the number of connections */
#define EWS_CONNECTION_MAX_REQUESTS 1
-#define QUEUE_LOCK(x) (g_static_rec_mutex_lock(&(x)->priv->queue_lock))
-#define QUEUE_UNLOCK(x) (g_static_rec_mutex_unlock(&(x)->priv->queue_lock))
+#define QUEUE_LOCK(x) (g_rec_mutex_lock(&(x)->priv->queue_lock))
+#define QUEUE_UNLOCK(x) (g_rec_mutex_unlock(&(x)->priv->queue_lock))
#define CHECK_ELEMENT(element_name, expected_name) \
(check_element (G_STRFUNC, (element_name), (expected_name)))
struct _EwsNode;
-static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
+static GMutex connecting;
static GHashTable *loaded_connections_permissions = NULL;
static gint comp_func (gconstpointer a, gconstpointer b);
@@ -76,7 +77,7 @@ struct _EEwsConnectionPrivate {
GMainContext *soup_context;
CamelEwsSettings *settings;
- GMutex *password_lock;
+ GMutex password_lock;
/* Hash key for the loaded_connections_permissions table. */
gchar *hash_key;
@@ -87,7 +88,7 @@ struct _EEwsConnectionPrivate {
GSList *jobs;
GSList *active_job_queue;
- GStaticRecMutex queue_lock;
+ GRecMutex queue_lock;
};
enum {
@@ -180,9 +181,12 @@ ews_unref_in_thread_func (gpointer data)
static void
ews_unref_in_thread (gpointer object)
{
+ GThread *thread;
+
g_return_if_fail (G_IS_OBJECT (object));
- g_thread_create (ews_unref_in_thread_func, object, FALSE, NULL);
+ thread = g_thread_new (NULL, ews_unref_in_thread_func, object);
+ g_thread_unref (thread);
}
static void
@@ -1245,7 +1249,7 @@ ews_connection_dispose (GObject *object)
priv = E_EWS_CONNECTION_GET_PRIVATE (object);
- g_static_mutex_lock (&connecting);
+ g_mutex_lock (&connecting);
/* remove the connection from the hash table */
if (loaded_connections_permissions != NULL) {
@@ -1257,7 +1261,7 @@ ews_connection_dispose (GObject *object)
}
}
- g_static_mutex_unlock (&connecting);
+ g_mutex_unlock (&connecting);
if (priv->soup_session) {
g_signal_handlers_disconnect_by_func (
@@ -1307,8 +1311,8 @@ ews_connection_finalize (GObject *object)
g_free (priv->email);
g_free (priv->hash_key);
- g_mutex_free (priv->password_lock);
- g_static_rec_mutex_free (&priv->queue_lock);
+ g_mutex_clear (&priv->password_lock);
+ g_rec_mutex_clear (&priv->queue_lock);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_ews_connection_parent_class)->finalize (object);
@@ -1438,7 +1442,7 @@ e_ews_connection_init (EEwsConnection *cnc)
cnc->priv->soup_context = g_main_context_new ();
cnc->priv->soup_loop = g_main_loop_new (cnc->priv->soup_context, FALSE);
- cnc->priv->soup_thread = g_thread_create (e_ews_soup_thread, cnc, TRUE, NULL);
+ cnc->priv->soup_thread = g_thread_new (NULL, e_ews_soup_thread, cnc);
/* create the SoupSession for this connection */
cnc->priv->soup_session = soup_session_async_new_with_options (
@@ -1455,8 +1459,8 @@ e_ews_connection_init (EEwsConnection *cnc)
SOUP_SESSION_FEATURE (logger));
}
- cnc->priv->password_lock = g_mutex_new ();
- g_static_rec_mutex_init (&cnc->priv->queue_lock);
+ g_mutex_init (&cnc->priv->password_lock);
+ g_rec_mutex_init (&cnc->priv->queue_lock);
g_signal_connect (
cnc->priv->soup_session, "authenticate",
@@ -1553,7 +1557,7 @@ e_ews_connection_find (const gchar *uri,
EEwsConnection *cnc;
gchar *hash_key;
- g_static_mutex_lock (&connecting);
+ g_mutex_lock (&connecting);
/* search the connection in our hash table */
if (loaded_connections_permissions != NULL) {
@@ -1567,12 +1571,12 @@ e_ews_connection_find (const gchar *uri,
if (E_IS_EWS_CONNECTION (cnc)) {
g_object_ref (cnc);
- g_static_mutex_unlock (&connecting);
+ g_mutex_unlock (&connecting);
return cnc;
}
}
- g_static_mutex_unlock (&connecting);
+ g_mutex_unlock (&connecting);
return NULL;
}
@@ -1604,7 +1608,7 @@ e_ews_connection_new (const gchar *uri,
hash_key = g_strdup_printf ("%s %s", user, uri);
g_free (user);
- g_static_mutex_lock (&connecting);
+ g_mutex_lock (&connecting);
/* search the connection in our hash table */
if (loaded_connections_permissions != NULL) {
@@ -1616,7 +1620,7 @@ e_ews_connection_new (const gchar *uri,
g_free (hash_key);
- g_static_mutex_unlock (&connecting);
+ g_mutex_unlock (&connecting);
return cnc;
}
}
@@ -1652,7 +1656,7 @@ e_ews_connection_new (const gchar *uri,
g_strdup (cnc->priv->hash_key), cnc);
/* free memory */
- g_static_mutex_unlock (&connecting);
+ g_mutex_unlock (&connecting);
return cnc;
}
@@ -1681,12 +1685,12 @@ e_ews_connection_dup_password (EEwsConnection *cnc)
g_return_val_if_fail (E_IS_EWS_CONNECTION (cnc), NULL);
- g_mutex_lock (cnc->priv->password_lock);
+ g_mutex_lock (&cnc->priv->password_lock);
protected = e_ews_connection_get_password (cnc);
duplicate = g_strdup (protected);
- g_mutex_unlock (cnc->priv->password_lock);
+ g_mutex_unlock (&cnc->priv->password_lock);
return duplicate;
}
@@ -1697,7 +1701,7 @@ e_ews_connection_set_password (EEwsConnection *cnc,
{
g_return_if_fail (E_IS_EWS_CONNECTION (cnc));
- g_mutex_lock (cnc->priv->password_lock);
+ g_mutex_lock (&cnc->priv->password_lock);
/* Zero-fill the old password before freeing it. */
if (cnc->priv->password != NULL && *cnc->priv->password != '\0')
@@ -1706,7 +1710,7 @@ e_ews_connection_set_password (EEwsConnection *cnc,
g_free (cnc->priv->password);
cnc->priv->password = g_strdup (password);
- g_mutex_unlock (cnc->priv->password_lock);
+ g_mutex_unlock (&cnc->priv->password_lock);
g_object_notify (G_OBJECT (cnc), "password");
}
diff --git a/src/server/e-ews-folder.c b/src/server/e-ews-folder.c
index 80d2e0c..50bf832 100644
--- a/src/server/e-ews-folder.c
+++ b/src/server/e-ews-folder.c
@@ -22,6 +22,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+
#include <string.h>
#include <glib/gi18n-lib.h>
diff --git a/src/server/e-ews-item-change.c b/src/server/e-ews-item-change.c
index 6a75652..b598aa0 100644
--- a/src/server/e-ews-item-change.c
+++ b/src/server/e-ews-item-change.c
@@ -19,6 +19,10 @@
* USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-soap-message.h"
#include "e-soap-response.h"
#include "e-ews-message.h"
diff --git a/src/server/e-ews-message.c b/src/server/e-ews-message.c
index f1077aa..7ca0464 100644
--- a/src/server/e-ews-message.c
+++ b/src/server/e-ews-message.c
@@ -21,7 +21,10 @@
* USA
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <string.h>
#include <libsoup/soup-uri.h>
#include "e-ews-message.h"
diff --git a/src/server/e-ews-oof-settings.c b/src/server/e-ews-oof-settings.c
index 3138271..3b382aa 100644
--- a/src/server/e-ews-oof-settings.c
+++ b/src/server/e-ews-oof-settings.c
@@ -16,9 +16,12 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-ews-oof-settings.h"
-#include <config.h>
#include <glib/gi18n-lib.h>
#include <libedataserver/libedataserver.h>
@@ -38,7 +41,7 @@ static void e_ews_oof_settings_async_initable_init
(GAsyncInitableIface *interface);
struct _EEwsOofSettingsPrivate {
- GMutex *property_lock;
+ GMutex property_lock;
EEwsConnection *connection;
EEwsOofState state;
EEwsExternalAudience external_audience;
@@ -404,7 +407,7 @@ ews_oof_settings_finalize (GObject *object)
priv = E_EWS_OOF_SETTINGS_GET_PRIVATE (object);
- g_mutex_free (priv->property_lock);
+ g_mutex_clear (&priv->property_lock);
g_date_time_unref (priv->start_time);
g_date_time_unref (priv->end_time);
@@ -605,7 +608,7 @@ e_ews_oof_settings_init (EEwsOofSettings *settings)
{
settings->priv = E_EWS_OOF_SETTINGS_GET_PRIVATE (settings);
- settings->priv->property_lock = g_mutex_new ();
+ g_mutex_init (&settings->priv->property_lock);
/* This is just to make sure the values are never NULL.
* They will be destroyed as soon as we get real values. */
@@ -744,10 +747,10 @@ e_ews_oof_settings_set_start_time (EEwsOofSettings *settings,
g_return_if_fail (E_IS_EWS_OOF_SETTINGS (settings));
g_return_if_fail (start_time != NULL);
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
if (g_date_time_compare (settings->priv->start_time, start_time) == 0) {
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return;
}
@@ -756,7 +759,7 @@ e_ews_oof_settings_set_start_time (EEwsOofSettings *settings,
settings->priv->start_time = g_date_time_ref (start_time);
}
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
g_object_notify (G_OBJECT (settings), "start-time");
}
@@ -776,10 +779,10 @@ e_ews_oof_settings_set_end_time (EEwsOofSettings *settings,
g_return_if_fail (E_IS_EWS_OOF_SETTINGS (settings));
g_return_if_fail (end_time != NULL);
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
if (g_date_time_compare (settings->priv->end_time, end_time) == 0) {
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return;
}
@@ -788,7 +791,7 @@ e_ews_oof_settings_set_end_time (EEwsOofSettings *settings,
settings->priv->end_time = g_date_time_ref (end_time);
}
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
g_object_notify (G_OBJECT (settings), "end-time");
}
@@ -809,12 +812,12 @@ e_ews_oof_settings_dup_internal_reply (EEwsOofSettings *settings)
g_return_val_if_fail (E_IS_EWS_OOF_SETTINGS (settings), NULL);
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
protected = e_ews_oof_settings_get_internal_reply (settings);
duplicate = g_strdup (protected);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return duplicate;
}
@@ -825,17 +828,17 @@ e_ews_oof_settings_set_internal_reply (EEwsOofSettings *settings,
{
g_return_if_fail (E_IS_EWS_OOF_SETTINGS (settings));
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
if (g_strcmp0 (internal_reply, settings->priv->internal_reply) == 0) {
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return;
}
g_free (settings->priv->internal_reply);
settings->priv->internal_reply = g_strdup (internal_reply);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
g_object_notify (G_OBJECT (settings), "internal-reply");
}
@@ -856,12 +859,12 @@ e_ews_oof_settings_dup_external_reply (EEwsOofSettings *settings)
g_return_val_if_fail (E_IS_EWS_OOF_SETTINGS (settings), NULL);
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
protected = e_ews_oof_settings_get_external_reply (settings);
duplicate = g_strdup (protected);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return duplicate;
}
@@ -872,17 +875,17 @@ e_ews_oof_settings_set_external_reply (EEwsOofSettings *settings,
{
g_return_if_fail (E_IS_EWS_OOF_SETTINGS (settings));
- g_mutex_lock (settings->priv->property_lock);
+ g_mutex_lock (&settings->priv->property_lock);
if (g_strcmp0 (external_reply, settings->priv->external_reply) == 0) {
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
return;
}
g_free (settings->priv->external_reply);
settings->priv->external_reply = g_strdup (external_reply);
- g_mutex_unlock (settings->priv->property_lock);
+ g_mutex_unlock (&settings->priv->property_lock);
g_object_notify (G_OBJECT (settings), "external-reply");
}
diff --git a/src/server/e-soap-response.c b/src/server/e-soap-response.c
index 74edda7..e146b17 100644
--- a/src/server/e-soap-response.c
+++ b/src/server/e-soap-response.c
@@ -3,6 +3,10 @@
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <libedataserver/eds-version.h>
#include <stdlib.h>
diff --git a/src/server/e-source-ews-folder.c b/src/server/e-source-ews-folder.c
index 107c378..ba9cd4e 100644
--- a/src/server/e-source-ews-folder.c
+++ b/src/server/e-source-ews-folder.c
@@ -16,6 +16,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-source-ews-folder.h"
#define E_SOURCE_EWS_FOLDER_GET_PRIVATE(obj) \
@@ -23,7 +27,7 @@
((obj), E_TYPE_SOURCE_EWS_FOLDER, ESourceEwsFolderPrivate))
struct _ESourceEwsFolderPrivate {
- GMutex *property_lock;
+ GMutex property_lock;
gchar *change_key;
gchar *id;
gboolean foreign;
@@ -109,7 +113,7 @@ source_ews_folder_finalize (GObject *object)
priv = E_SOURCE_EWS_FOLDER_GET_PRIVATE (object);
- g_mutex_free (priv->property_lock);
+ g_mutex_clear (&priv->property_lock);
g_free (priv->change_key);
g_free (priv->id);
@@ -184,7 +188,7 @@ static void
e_source_ews_folder_init (ESourceEwsFolder *extension)
{
extension->priv = E_SOURCE_EWS_FOLDER_GET_PRIVATE (extension);
- extension->priv->property_lock = g_mutex_new ();
+ g_mutex_init (&extension->priv->property_lock);
}
void
@@ -212,12 +216,12 @@ e_source_ews_folder_dup_change_key (ESourceEwsFolder *extension)
g_return_val_if_fail (E_IS_SOURCE_EWS_FOLDER (extension), NULL);
- g_mutex_lock (extension->priv->property_lock);
+ g_mutex_lock (&extension->priv->property_lock);
protected = e_source_ews_folder_get_change_key (extension);
duplicate = g_strdup (protected);
- g_mutex_unlock (extension->priv->property_lock);
+ g_mutex_unlock (&extension->priv->property_lock);
return duplicate;
}
@@ -228,17 +232,17 @@ e_source_ews_folder_set_change_key (ESourceEwsFolder *extension,
{
g_return_if_fail (E_IS_SOURCE_EWS_FOLDER (extension));
- g_mutex_lock (extension->priv->property_lock);
+ g_mutex_lock (&extension->priv->property_lock);
if (g_strcmp0 (extension->priv->change_key, change_key) == 0) {
- g_mutex_unlock (extension->priv->property_lock);
+ g_mutex_unlock (&extension->priv->property_lock);
return;
}
g_free (extension->priv->change_key);
extension->priv->change_key = g_strdup (change_key);
- g_mutex_unlock (extension->priv->property_lock);
+ g_mutex_unlock (&extension->priv->property_lock);
g_object_notify (G_OBJECT (extension), "change-key");
}
@@ -259,12 +263,12 @@ e_source_ews_folder_dup_id (ESourceEwsFolder *extension)
g_return_val_if_fail (E_IS_SOURCE_EWS_FOLDER (extension), NULL);
- g_mutex_lock (extension->priv->property_lock);
+ g_mutex_lock (&extension->priv->property_lock);
protected = e_source_ews_folder_get_id (extension);
duplicate = g_strdup (protected);
- g_mutex_unlock (extension->priv->property_lock);
+ g_mutex_unlock (&extension->priv->property_lock);
return duplicate;
}
@@ -275,17 +279,17 @@ e_source_ews_folder_set_id (ESourceEwsFolder *extension,
{
g_return_if_fail (E_IS_SOURCE_EWS_FOLDER (extension));
- g_mutex_lock (extension->priv->property_lock);
+ g_mutex_lock (&extension->priv->property_lock);
if (g_strcmp0 (extension->priv->id, id) == 0) {
- g_mutex_unlock (extension->priv->property_lock);
+ g_mutex_unlock (&extension->priv->property_lock);
return;
}
g_free (extension->priv->id);
extension->priv->id = g_strdup (id);
- g_mutex_unlock (extension->priv->property_lock);
+ g_mutex_unlock (&extension->priv->property_lock);
g_object_notify (G_OBJECT (extension), "id");
}
@@ -298,12 +302,12 @@ e_source_ews_folder_dup_folder_id (ESourceEwsFolder *extension)
g_return_val_if_fail (E_IS_SOURCE_EWS_FOLDER (extension), NULL);
- g_mutex_lock (extension->priv->property_lock);
+ g_mutex_lock (&extension->priv->property_lock);
folder_id = e_ews_folder_id_new (
extension->priv->id, extension->priv->change_key, FALSE);
- g_mutex_unlock (extension->priv->property_lock);
+ g_mutex_unlock (&extension->priv->property_lock);
return folder_id;
}
diff --git a/src/server/ews-errors.c b/src/server/ews-errors.c
index 5bd23e1..4e4a0f4 100644
--- a/src/server/ews-errors.c
+++ b/src/server/ews-errors.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "ews-errors.h"
static GHashTable *ews_error_hash = NULL;
diff --git a/src/utils/e-ews-query-to-restriction.c b/src/utils/e-ews-query-to-restriction.c
index 166e866..3069481 100644
--- a/src/utils/e-ews-query-to-restriction.c
+++ b/src/utils/e-ews-query-to-restriction.c
@@ -22,6 +22,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+
#include <string.h>
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
diff --git a/src/utils/e-sqlite3-vfs.c b/src/utils/e-sqlite3-vfs.c
index 080180f..cec0b75 100644
--- a/src/utils/e-sqlite3-vfs.c
+++ b/src/utils/e-sqlite3-vfs.c
@@ -18,9 +18,12 @@
* USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <sqlite3.h>
#include <glib.h>
-#include <config.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -39,7 +42,7 @@ static GThreadPool *sync_pool = NULL;
typedef struct {
sqlite3_file parent;
sqlite3_file *old_vfs_file; /* pointer to old_vfs' file */
- GStaticRecMutex sync_mutex;
+ GRecMutex sync_mutex;
guint timeout_id;
gint flags;
} ESqlite3File;
@@ -92,7 +95,7 @@ sync_push_request (ESqlite3File *cFile,
g_return_if_fail (cFile != NULL);
g_return_if_fail (sync_pool != NULL);
- g_static_rec_mutex_lock (&cFile->sync_mutex);
+ g_rec_mutex_lock (&cFile->sync_mutex);
if (wait_for_finish)
sync_op = e_flag_new ();
@@ -104,7 +107,7 @@ sync_push_request (ESqlite3File *cFile,
cFile->flags = 0;
- g_static_rec_mutex_unlock (&cFile->sync_mutex);
+ g_rec_mutex_unlock (&cFile->sync_mutex);
g_thread_pool_push (sync_pool, data, &error);
@@ -127,14 +130,14 @@ sync_push_request (ESqlite3File *cFile,
static gboolean
sync_push_request_timeout (ESqlite3File *cFile)
{
- g_static_rec_mutex_lock (&cFile->sync_mutex);
+ g_rec_mutex_lock (&cFile->sync_mutex);
if (cFile->timeout_id != 0) {
sync_push_request (cFile, FALSE);
cFile->timeout_id = 0;
}
- g_static_rec_mutex_unlock (&cFile->sync_mutex);
+ g_rec_mutex_unlock (&cFile->sync_mutex);
return FALSE;
}
@@ -195,7 +198,7 @@ e_sqlite3_file_xClose (sqlite3_file *pFile)
cFile = (ESqlite3File *) pFile;
- g_static_rec_mutex_lock (&cFile->sync_mutex);
+ g_rec_mutex_lock (&cFile->sync_mutex);
/* Cancel any pending sync requests. */
if (cFile->timeout_id > 0) {
@@ -203,7 +206,7 @@ e_sqlite3_file_xClose (sqlite3_file *pFile)
cFile->timeout_id = 0;
}
- g_static_rec_mutex_unlock (&cFile->sync_mutex);
+ g_rec_mutex_unlock (&cFile->sync_mutex);
/* Make the last sync. */
sync_push_request (cFile, TRUE);
@@ -216,7 +219,7 @@ e_sqlite3_file_xClose (sqlite3_file *pFile)
g_free (cFile->old_vfs_file);
cFile->old_vfs_file = NULL;
- g_static_rec_mutex_free (&cFile->sync_mutex);
+ g_rec_mutex_clear (&cFile->sync_mutex);
return res;
}
@@ -232,7 +235,7 @@ e_sqlite3_file_xSync (sqlite3_file *pFile,
cFile = (ESqlite3File *) pFile;
- g_static_rec_mutex_lock (&cFile->sync_mutex);
+ g_rec_mutex_lock (&cFile->sync_mutex);
/* If a sync request is already scheduled, accumulate flags. */
cFile->flags |= flags;
@@ -246,7 +249,7 @@ e_sqlite3_file_xSync (sqlite3_file *pFile,
SYNC_TIMEOUT_SECONDS, (GSourceFunc)
sync_push_request_timeout, cFile);
- g_static_rec_mutex_unlock (&cFile->sync_mutex);
+ g_rec_mutex_unlock (&cFile->sync_mutex);
return SQLITE_OK;
}
@@ -258,7 +261,7 @@ e_sqlite3_vfs_xOpen (sqlite3_vfs *pVfs,
gint flags,
gint *pOutFlags)
{
- static GStaticRecMutex only_once_lock = G_STATIC_REC_MUTEX_INIT;
+ static GRecMutex only_once_lock;
static sqlite3_io_methods io_methods = {0};
ESqlite3File *cFile;
gint res;
@@ -275,9 +278,9 @@ e_sqlite3_vfs_xOpen (sqlite3_vfs *pVfs,
return res;
}
- g_static_rec_mutex_init (&cFile->sync_mutex);
+ g_rec_mutex_init (&cFile->sync_mutex);
- g_static_rec_mutex_lock (&only_once_lock);
+ g_rec_mutex_lock (&only_once_lock);
if (!sync_pool)
sync_pool = g_thread_pool_new (sync_request_thread_cb, NULL, 2, FALSE, NULL);
@@ -310,7 +313,7 @@ e_sqlite3_vfs_xOpen (sqlite3_vfs *pVfs,
#undef use_subclassed
}
- g_static_rec_mutex_unlock (&only_once_lock);
+ g_rec_mutex_unlock (&only_once_lock);
cFile->parent.pMethods = &io_methods;
diff --git a/src/utils/ews-test-finditem-query.c b/src/utils/ews-test-finditem-query.c
index 2c936c3..091a3c7 100644
--- a/src/utils/ews-test-finditem-query.c
+++ b/src/utils/ews-test-finditem-query.c
@@ -21,6 +21,10 @@
/* APIs : e_ews_connection_find_folder_items; e_ews_query_to_restriction; */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <ctype.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]