aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-10-27 13:27:40 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-10-27 13:27:40 +0800
commitdfd9f8393301adb59d6ca71de6f6191c838c4a39 (patch)
tree571e734c87c0f830fd7df576fe0e35444a529375 /addressbook
parent04dd6641755b4e64506799b284b4959c2f99659e (diff)
downloadgsoc2013-evolution-dfd9f8393301adb59d6ca71de6f6191c838c4a39.tar
gsoc2013-evolution-dfd9f8393301adb59d6ca71de6f6191c838c4a39.tar.gz
gsoc2013-evolution-dfd9f8393301adb59d6ca71de6f6191c838c4a39.tar.bz2
gsoc2013-evolution-dfd9f8393301adb59d6ca71de6f6191c838c4a39.tar.lz
gsoc2013-evolution-dfd9f8393301adb59d6ca71de6f6191c838c4a39.tar.xz
gsoc2013-evolution-dfd9f8393301adb59d6ca71de6f6191c838c4a39.tar.zst
gsoc2013-evolution-dfd9f8393301adb59d6ca71de6f6191c838c4a39.zip
Added paranoid reentrancy guards. (pas_book_queue_request): Changed our
2001-10-27 Jon Trowbridge <trow@ximian.com> * backend/pas/pas-book.c (pas_book_check_queue): Added paranoid reentrancy guards. (pas_book_queue_request): Changed our idle handler into a timeout, so as to work w/ reentrancy guards. (pas_book_init): Explicit initialization. svn path=/trunk/; revision=14202
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog8
-rw-r--r--addressbook/backend/pas/pas-book.c22
2 files changed, 25 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index e4169c4c7e..b20e9f2974 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,11 @@
+2001-10-27 Jon Trowbridge <trow@ximian.com>
+
+ * backend/pas/pas-book.c (pas_book_check_queue): Added paranoid
+ reentrancy guards.
+ (pas_book_queue_request): Changed our idle handler into a timeout,
+ so as to work w/ reentrancy guards.
+ (pas_book_init): Explicit initialization.
+
2001-10-26 Chris Toshok <toshok@ximian.com>
* gui/component/addressbook.h: add prototypes for
diff --git a/addressbook/backend/pas/pas-book.c b/addressbook/backend/pas/pas-book.c
index 306d7e5f39..e67ae51842 100644
--- a/addressbook/backend/pas/pas-book.c
+++ b/addressbook/backend/pas/pas-book.c
@@ -25,23 +25,33 @@ struct _PASBookPrivate {
GNOME_Evolution_Addressbook_BookListener listener;
GList *request_queue;
- gint idle_id;
+ gint timeout_id;
+
+ guint timeout_lock : 1;
};
static gboolean
pas_book_check_queue (PASBook *book)
{
+ if (book->priv->timeout_lock)
+ return TRUE;
+
+ book->priv->timeout_lock = TRUE;
+
if (book->priv->request_queue != NULL) {
gtk_signal_emit (GTK_OBJECT (book),
pas_book_signals [REQUESTS_QUEUED]);
}
if (book->priv->request_queue == NULL) {
- book->priv->idle_id = 0;
+ book->priv->timeout_id = 0;
+ book->priv->timeout_lock = FALSE;
gtk_object_unref (GTK_OBJECT (book));
return FALSE;
}
+ book->priv->timeout_lock = FALSE;
+
return TRUE;
}
@@ -51,9 +61,9 @@ pas_book_queue_request (PASBook *book, PASRequest *req)
book->priv->request_queue =
g_list_append (book->priv->request_queue, req);
- if (book->priv->idle_id == 0) {
+ if (book->priv->timeout_id == 0) {
gtk_object_ref (GTK_OBJECT (book));
- book->priv->idle_id = g_idle_add ((GSourceFunc) pas_book_check_queue, book);
+ book->priv->timeout_id = g_timeout_add (20, (GSourceFunc) pas_book_check_queue, book);
}
}
@@ -839,8 +849,10 @@ static void
pas_book_init (PASBook *book)
{
book->priv = g_new0 (PASBookPrivate, 1);
- book->priv->idle_id = 0;
+ book->priv->timeout_id = 0;
book->priv->request_queue = NULL;
+ book->priv->timeout_id = 0;
+ book->priv->timeout_lock = FALSE;
}
/**