Changeset 3764

Show
Ignore:
Timestamp:
09/16/08 17:25:31
Author:
jdapena
Message:

* libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c

(let_idle_die): do a trylock in connect_lock instead of lock, so that
we can avoid interlocks on stop_idle called from imap_command_start
(merged from trunk r3763).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • releases/modest/diablo-pe2/ChangeLog

    r3761 r3764  
    1 2008-10-10  Sergio Villar Senin  <svillar@igalia.com> 
     12008-09-16  Jose Dapena Paz  <jdapena@igalia.com> 
     2 
     3        * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c 
     4        (let_idle_die): do a trylock in connect_lock instead of lock, so that 
     5        we can avoid interlocks on stop_idle called from imap_command_start 
     6        (merged from trunk r3763). 
     7 
     82008-09-10  Sergio Villar Senin  <svillar@igalia.com> 
    29 
    310        * libtinymail-camel/camel-lite/camel/providers/local/camel-mailder-store.c 
  • releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c

    r3724 r3764  
    233233 
    234234                idle_debug ("Sending DONE in let_idle_die\n"); 
    235                 CAMEL_SERVICE_REC_LOCK (store, connect_lock); 
    236                 nwritten = camel_stream_printf (store->ostream, "DONE\r\n"); 
    237                 if (nwritten != -1) { 
    238                         resp = NULL; 
    239                         while ((camel_imap_command_response_idle (store, &resp, &ex)) == CAMEL_IMAP_RESPONSE_UNTAGGED) { 
    240                                 idle_debug ("(.., ..) <- %s | in let_idle_die\n", resp); 
    241                                 g_free (resp); resp=NULL; 
     235                /* We replace the lock with a try lock. If some other is retaining the connect lock, then we don't need that someone breaks 
     236                 * the idle */ 
     237                if (CAMEL_SERVICE_REC_TRYLOCK (store, connect_lock)) { 
     238                        nwritten = camel_stream_printf (store->ostream, "DONE\r\n"); 
     239                        if (nwritten != -1) { 
     240                                resp = NULL; 
     241                                while ((camel_imap_command_response_idle (store, &resp, &ex)) == CAMEL_IMAP_RESPONSE_UNTAGGED) { 
     242                                        idle_debug ("(.., ..) <- %s | in let_idle_die\n", resp); 
     243                                        g_free (resp); resp=NULL; 
     244                                } 
     245                                if (resp) { 
     246                                        idle_debug ("(.., ..) <- %s\n", resp); 
     247                                        g_free (resp); 
     248                                } 
    242249                        } 
    243                         if (resp) { 
    244                                 idle_debug ("(.., ..) <- %s\n", resp); 
    245                                 g_free (resp); 
    246                         } 
    247                 } 
    248                 CAMEL_SERVICE_REC_UNLOCK (store, connect_lock); 
     250                        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock); 
     251                } 
    249252                g_free (store->idle_prefix); 
    250253                store->idle_prefix=NULL;