[telepathy-gabble/master] be less fussy about scheduling pipeline runs when enqueuing a pipeline request

Dafydd Harries dafydd.harries at collabora.co.uk
Thu Aug 6 05:46:25 PDT 2009


Previously, a queue run would only be scheduled if there were no requests
currently in flight, as opposed to less than REQUEST_PIPELINE_SIZE.
---
 src/request-pipeline.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/request-pipeline.c b/src/request-pipeline.c
index a398cfe..833a2c5 100644
--- a/src/request-pipeline.c
+++ b/src/request-pipeline.c
@@ -396,11 +396,11 @@ gabble_request_pipeline_enqueue (GabbleRequestPipeline *pipeline,
 
   DEBUG ("enqueued new request as item %p", item);
 
-  /* if this is the first request in pipeline, run it delayed so in the
-   * case of errors the callback will be called after this function returns
+  /* If the pipeline isn't full, schedule a run. Run it delayed so that if
+   * there's an error, the callback will be called after this function returns.
    */
-  if (NULL == priv->items_in_flight)
-      g_idle_add (delayed_run_pipeline, pipeline);
+  if (g_slist_length (priv->items_in_flight) < REQUEST_PIPELINE_SIZE)
+    g_idle_add (delayed_run_pipeline, pipeline);
 
   return item;
 }
-- 
1.5.6.5




More information about the telepathy-commits mailing list