Changeset 3762

Show
Ignore:
Timestamp:
09/11/08 18:26:35
Author:
svillar
Message:
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/camel-provider.c

    r3714 r3762  
    270270} 
    271271 
    272 void camel_provider_shutdown (CamelProvider *provider) 
    273 { 
    274         if (provider->shutdown) { 
    275                 provider->shutdown ((CamelObject *) provider); 
    276         } 
    277 } 
    278  
    279 void camel_provider_shutdown_all (void) 
    280 { 
    281         GList *providers_list; 
    282         GList *node; 
    283  
    284         providers_list = camel_provider_list (FALSE); 
    285         for (node = providers_list; node != NULL; node = g_list_next (node)) { 
    286                 CamelProvider *provider = (CamelProvider *) node->data; 
    287                 camel_provider_shutdown (provider); 
    288         } 
    289         g_list_free (providers_list); 
    290 } 
    291  
    292272static gint 
    293273provider_compare (gconstpointer a, gconstpointer b) 
  • releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/camel-provider.h

    r3714 r3762  
    145145 
    146146typedef int (*CamelProviderAutoDetectFunc) (CamelURL *url, GHashTable **auto_detected, CamelException *ex); 
    147 typedef void (*CamelProviderShutdownFunc) (CamelObject *provider); 
    148  
    149147 
    150148typedef struct { 
     
    211209        const char *license_file; 
    212210 
    213         /* Shutdown function. Will be called in camel_shutdown. 
    214          */ 
    215         CamelProviderShutdownFunc shutdown; 
    216  
    217211        /* Private to the provider */ 
    218212        void *priv; 
     
    231225void camel_provider_load(const char *path, CamelException *ex); 
    232226void camel_provider_register(CamelProvider *provider); 
    233 void camel_provider_shutdown (CamelProvider *provider); 
    234 void camel_provider_shutdown_all (void); 
    235227GList *camel_provider_list(gboolean load); 
    236228CamelProvider *camel_provider_get(const char *url_string, CamelException *ex); 
  • releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/camel.c

    r3719 r3762  
    5454        if (!initialised) 
    5555                return; 
    56  
    57         camel_provider_shutdown_all (); 
    5856 
    5957        initialised = FALSE; 
  • releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-provider.c

    r3714 r3762  
    114114        imap_provider.authtypes = g_list_prepend (imap_provider.authtypes, &camel_imap_password_authtype); 
    115115        imap_provider.translation_domain = GETTEXT_PACKAGE; 
    116         imap_provider.shutdown = NULL; 
    117116 
    118117        camel_provider_register(&imap_provider); 
  • releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-provider.c

    r3714 r3762  
    9090}; 
    9191 
    92 static void 
    93 pop3_shutdown (CamelProvider *provider) 
    94 { 
    95         camel_pop3_store_kill_threads (); 
    96 } 
    97  
    9892void 
    9993camel_provider_module_init(void) 
     
    112106        pop3_provider.authtypes = g_list_prepend(pop3_provider.authtypes, &camel_pop3_password_authtype); 
    113107        pop3_provider.translation_domain = GETTEXT_PACKAGE; 
    114         pop3_provider.shutdown = pop3_shutdown; 
    115108 
    116109        camel_provider_register(&pop3_provider); 
  • releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.c

    r3714 r3762  
    8484 
    8585static CamelStoreClass *parent_class = NULL; 
    86 static GMutex *wait_for_login_mutex = NULL; 
    87 static GCond *wait_for_login_cond = NULL; 
    88 static GList *wait_for_login_threads = NULL; 
    8986 
    9087static void finalize (CamelObject *object); 
     
    178175        } 
    179176 
    180         g_static_rec_mutex_unlock (store->eng_lock); 
    181  
    182177        g_timeout_add (20000, unref_it, store->engine); 
    183178        store->engine = NULL; 
     179        g_static_rec_mutex_unlock (store->eng_lock); 
    184180 
    185181        /* camel_object_unref((CamelObject *)store->engine); */ 
     
    408404        g_static_rec_mutex_unlock (store->eng_lock); 
    409405 
    410         g_mutex_lock (wait_for_login_mutex); 
    411406        while (!killed) { 
    412                 GTimeVal tv_delay = {0, 0}; 
    413  
    414                 tv_delay.tv_sec = login_delay; 
    415  
    416                 g_cond_timed_wait (wait_for_login_cond, wait_for_login_mutex, &tv_delay); 
    417  
    418                 if (!store->engine) { 
    419                         break; 
    420                 } 
     407 
     408                sleep (login_delay); 
     409 
    421410 
    422411                if (!store->is_refreshing) { 
     
    434423 
    435424        camel_object_unref (store); 
    436         wait_for_login_threads = g_list_append (wait_for_login_threads, store->login_delay_thread); 
    437         g_mutex_unlock (wait_for_login_mutex); 
    438425        return NULL; 
    439426} 
     
    934921camel_pop3_store_prepare (CamelStore *store) 
    935922{ 
    936         CamelPOP3Store *pstore = (CamelPOP3Store *) store; 
    937923        camel_object_ref (store); 
    938         g_mutex_lock (wait_for_login_mutex); 
    939         pstore->login_delay_thread = g_thread_create (wait_for_login_delay, store, TRUE, NULL); 
    940         g_mutex_unlock (wait_for_login_mutex); 
     924        g_thread_create (wait_for_login_delay, store, FALSE, NULL); 
    941925} 
    942926 
     
    10361020 
    10371021        g_timeout_add (20000, unref_it, store->engine); 
     1022        /* camel_object_unref((CamelObject *)store->engine); */ 
    10381023        store->engine = NULL; 
     1024 
    10391025        //g_static_rec_mutex_unlock (store->eng_lock); 
    10401026 
     
    12141200} 
    12151201 
    1216 void 
    1217 camel_pop3_store_kill_threads (void) 
    1218 { 
    1219         GThread *thread_to_join; 
    1220         g_mutex_lock (wait_for_login_mutex); 
    1221         while (wait_for_login_threads) { 
    1222                 thread_to_join = wait_for_login_threads->data; 
    1223                 g_cond_broadcast (wait_for_login_cond); 
    1224                 g_mutex_unlock (wait_for_login_mutex); 
    1225                 g_thread_join (thread_to_join); 
    1226                 g_mutex_lock (wait_for_login_mutex); 
    1227                 wait_for_login_threads = g_list_remove (wait_for_login_threads, thread_to_join); 
    1228         } 
    1229         g_mutex_unlock (wait_for_login_mutex); 
    1230 } 
    1231  
    12321202static void 
    12331203camel_pop3_store_class_init (CamelPOP3StoreClass *camel_pop3_store_class) 
     
    12411211 
    12421212        parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_disco_store_get_type ())); 
    1243         wait_for_login_mutex = g_mutex_new (); 
    1244         wait_for_login_cond = g_cond_new (); 
    1245         wait_for_login_threads = NULL; 
    12461213 
    12471214        /* virtual method overload */ 
     
    12891256        store->uidl_lock = g_new0 (GStaticRecMutex, 1); 
    12901257        g_static_rec_mutex_init (store->uidl_lock); 
    1291         store->login_delay_thread = NULL; 
    12921258 
    12931259        return; 
  • releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.h

    r3714 r3762  
    5454        gpointer book; 
    5555        guint login_delay; 
    56         GThread *login_delay_thread; 
    5756 
    5857        GPtrArray *uids; 
     
    8079 
    8180void camel_pop3_store_destroy_lists (CamelPOP3Store *pop3_store); 
    82 void camel_pop3_store_kill_threads (void); 
    8381 
    8482G_END_DECLS