diff options
-rw-r--r-- | addressbook/ChangeLog | 8 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-book.c | 22 |
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; } /** |