Changeset 3757

Show
Ignore:
Timestamp:
09/04/08 11:10:58
Author:
jdapena
Message:

* libtinymail-camel/tny-camel-mime-part.c

(tny_camel_mime_part_decode_to_stream_async_default): make it really
asynchronous, doing the operation in a separate thread.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3754 r3757  
     12008-09-03  Jose Dapena Paz  <jdapena@igalia.com> 
     2 
     3        * libtinymail-camel/tny-camel-mime-part.c 
     4        (tny_camel_mime_part_decode_to_stream_async_default): make it really 
     5        asynchronous, doing the operation in a separate thread. 
     6 
    172008-09-03  Sergio Villar Senin  <svillar@igalia.com> 
    28 
  • trunk/libtinymail-camel/tny-camel-mime-part.c

    r3736 r3757  
    304304} 
    305305 
    306 /* This one is just to fulfil the API requirements */ 
     306static gpointer 
     307decode_to_stream_async_thread (gpointer userdata) 
     308
     309        DecodeAsyncInfo *info = (DecodeAsyncInfo *) userdata; 
     310 
     311        tny_mime_part_decode_to_stream (info->self, info->stream, &(info->err)); 
     312 
     313        g_idle_add_full (G_PRIORITY_HIGH,  
     314                         decode_async_callback,  
     315                         info, decode_async_destroyer); 
     316        return NULL; 
     317 
     318
    307319 
    308320static void 
     
    317329{ 
    318330        DecodeAsyncInfo *info = g_slice_new0 (DecodeAsyncInfo); 
    319  
    320         tny_mime_part_decode_to_stream (self, stream, NULL); 
    321331 
    322332        info->self = g_object_ref (self); 
     
    326336        info->err = NULL; 
    327337 
    328         g_idle_add_full (G_PRIORITY_HIGH,  
    329                                decode_async_callback,  
    330                                info, decode_async_destroyer); 
    331  
     338        if (g_thread_create (decode_to_stream_async_thread, info, FALSE, &(info->err)) == FALSE) { 
     339                g_critical ("%s failed: couldn't create the working thread", __FUNCTION__); 
     340        } 
     341                 
    332342        return; 
    333343}