From c0fa85ff6e91e2ad63d86bffad45a66164d9e24a Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Thu, 3 Feb 2011 16:23:05 +0200 Subject: [PATCH] =?utf8?q?=D0=92=D0=B8=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=BE=20=D0=BF=D0=BE=D0=BC=D0=B8=D0=BB=D0=BA=D1=83=20?= =?utf8?q?=D1=89=D0=BE=20=D0=BF=D1=80=D0=B8=D0=B7=D0=B2=D0=BE=D0=B4=D0=B8?= =?utf8?q?=D0=BB=D0=B0=20=D0=B4=D0=BE=20=D0=BC=D0=B0=D1=81=D0=BE=D0=B2?= =?utf8?q?=D0=B8=D1=85=20=D0=B4=D0=B8=D1=81=D0=BA=D0=BE=D0=BD=D0=BD=D0=B5?= =?utf8?q?=D0=BA=D1=82=D1=96=D0=B2=20=D0=BF=D1=96=D1=81=D0=BB=D1=8F=20?= =?utf8?q?=D0=BC=D0=B0=D1=81=D0=BE=D0=B2=D0=B8=D1=85=20=D0=BA=D0=BE=D0=BD?= =?utf8?q?=D0=BD=D0=B5=D0=BA=D1=82=D1=96=D0=B2=20close=20#14?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- projects/rscriptd/listener.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/projects/rscriptd/listener.cpp b/projects/rscriptd/listener.cpp index 82dd6318..814eb1d8 100644 --- a/projects/rscriptd/listener.cpp +++ b/projects/rscriptd/listener.cpp @@ -331,16 +331,10 @@ return false; //----------------------------------------------------------------------------- void LISTENER::ProcessPending() { -std::list localPending; - - { - STG_LOCKER lock(&mutex, __FILE__, __LINE__); - printfd(__FILE__, "Pending data size: %d\n", pending.size()); - localPending.swap(pending); - } - -std::list::iterator it(localPending.begin()); -while (it != localPending.end()) +std::list::iterator it(pending.begin()); +size_t count = 0; +printfd(__FILE__, "Pending: %d\n", pending.size()); +while (it != pending.end() && count < 256) { std::vector::iterator uit( std::lower_bound( @@ -381,7 +375,10 @@ while (it != localPending.end()) } } ++it; + ++count; } +STG_LOCKER lock(&mutex, __FILE__, __LINE__); +pending.erase(pending.begin(), it); } //----------------------------------------------------------------------------- void LISTENER::ProcessTimeouts() -- 2.44.2