Changeset 3597

Show
Ignore:
Timestamp:
04/18/08 11:23:51
Author:
pvanhoof
Message:

2008-04-18 Philip Van Hoof <pvanhoof@gnome.org>

cause a deathlock

        • Decprecated tny_send_queue_add, use tny_send_queue_add_async
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3596 r3597  
     12008-04-18  Philip Van Hoof <pvanhoof@gnome.org> 
     2 
     3        * Removed unnecessary old code rot in TnyCamelSendQueue that might 
     4        cause a deathlock 
     5        * Decprecated tny_send_queue_add, use tny_send_queue_add_async 
     6 
    172008-04-17  Philip Van Hoof <pvanhoof@gnome.org> 
    28 
  • trunk/libtinymail-camel/tny-camel-send-queue.c

    r3596 r3597  
    770770        GError *new_err = NULL; 
    771771 
    772         if (!err) { 
    773                 priv->total++; 
    774                 if (priv->total >= 1 && !priv->is_running) 
    775                         create_worker (info->self, &new_err); 
    776         } 
     772        if (!err & !priv->is_running) 
     773                create_worker (info->self, &new_err); 
    777774 
    778775        /* Call user callback after msg has beed added to OUTBOX, waiting to be sent*/ 
     
    866863        TnyCamelSendQueuePriv *priv = TNY_CAMEL_SEND_QUEUE_GET_PRIVATE (self); 
    867864        GError *err = NULL; 
     865        OnAddedInfo *info = NULL; 
     866        TnyFolder *outbox; 
    868867 
    869868        g_assert (TNY_IS_CAMEL_MSG (msg)); 
    870869 
    871         g_static_rec_mutex_lock (priv->todo_lock); 
    872         { 
    873                 TnyFolder *outbox; 
    874                 TnyList *headers = tny_simple_list_new (); 
    875                 OnAddedInfo *info = NULL; 
    876  
    877                 outbox = tny_send_queue_get_outbox (TNY_SEND_QUEUE (self)); 
    878  
    879                 if (!outbox || !TNY_IS_FOLDER (outbox)) 
    880                 { 
    881                         g_set_error (&err, TNY_SERVICE_ERROR,  
    882                                 TNY_SERVICE_ERROR_ADD_MSG, 
    883                                 _("Operating can't continue: send queue not ready " 
    884                                 "because it does not have a valid outbox. " 
    885                                 "This problem indicates a bug in the software.")); 
    886                         g_object_unref (headers); 
    887                         g_static_rec_mutex_unlock (priv->todo_lock); 
    888                         return; 
    889                 } 
    890  
    891                 tny_folder_get_headers (outbox, headers, TRUE, &err); 
    892  
    893                 if (err!= NULL) 
    894                 { 
    895                         g_object_unref (headers); 
    896                         g_object_unref (outbox); 
    897                         g_static_rec_mutex_unlock (priv->todo_lock); 
    898                         return; 
    899                 } 
    900  
    901                 priv->total = tny_list_get_length (headers); 
    902                 g_object_unref (headers); 
    903  
    904                 info = g_slice_new0 (OnAddedInfo); 
    905  
    906                 info->msg = TNY_MSG (g_object_ref (msg)); 
    907                 info->self = TNY_SEND_QUEUE (g_object_ref (self)); 
    908                 info->callback = callback; 
    909                 info->user_data = user_data; 
    910  
    911                 tny_folder_add_msg_async (outbox, msg, on_added, on_status, info); 
    912  
    913                 g_object_unref (outbox); 
    914         } 
    915         g_static_rec_mutex_unlock (priv->todo_lock); 
     870        outbox = tny_send_queue_get_outbox (TNY_SEND_QUEUE (self)); 
     871 
     872        if (!outbox || !TNY_IS_FOLDER (outbox)) { 
     873                g_set_error (&err, TNY_SERVICE_ERROR,  
     874                        TNY_SERVICE_ERROR_ADD_MSG, 
     875                        _("Operating can't continue: send queue not ready " 
     876                        "because it does not have a valid outbox. " 
     877                        "This problem indicates a bug in the software.")); 
     878 
     879                return; 
     880        } 
     881 
     882        info = g_slice_new0 (OnAddedInfo); 
     883 
     884        info->msg = TNY_MSG (g_object_ref (msg)); 
     885        info->self = TNY_SEND_QUEUE (g_object_ref (self)); 
     886        info->callback = callback; 
     887        info->user_data = user_data; 
     888 
     889        tny_folder_add_msg_async (outbox, msg, on_added, on_status, info); 
     890 
     891        g_object_unref (outbox); 
    916892 
    917893        return; 
  • trunk/libtinymail/tny-send-queue.c

    r3304 r3597  
    133133 * Add a message to the send queue, usually adding it to the outbox too. 
    134134 * 
     135 * Deprecated: 1.0: Use tny_send_queue_add_async in stead 
    135136 * since: 1.0 
    136137 * audience: application-developer