From 03ffe5d6bc7732880b3aff93b0f946a6d3ba7265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Thu, 6 Oct 2016 12:38:32 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@276 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/thread/pipipelinethread.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/thread/pipipelinethread.h b/src/thread/pipipelinethread.h index 88ea16cf..354ab277 100644 --- a/src/thread/pipipelinethread.h +++ b/src/thread/pipipelinethread.h @@ -33,7 +33,7 @@ public: PIPipelineThread() { cnt = 0; max_size = 0; - wait_next_pipe = true; + wait_next_pipe = false; next_overload = false; } ~PIPipelineThread() { @@ -48,7 +48,8 @@ public: EVENT_HANDLER1(void, enqueue, const Tin &, v) {enqueue(v, 0);} EVENT_HANDLER2(void, enqueue, const Tin &, v, bool *, overload) { mutex.lock(); - if (max_size > 0 && in.size() < max_size) { +// piCout << "enque" << max_size << in.size(); + if (max_size == 0 || in.size() < max_size) { in.enqueue(v); if (overload) *overload = false; } else { @@ -104,7 +105,7 @@ public: void setMaxQueSize(uint count) { mutex.lock(); - count = max_size; + max_size = count; if (max_size > 0 && in.size() > max_size) in.resize(max_size); mutex.unlock(); } @@ -125,17 +126,20 @@ private: return; } if (next_overload && wait_next_pipe) { + mutex.unlock(); calculated(last, &next_overload); + piMSleep(10); } else { Tin t = in.dequeue(); - bool ok = true; mutex.unlock(); + bool ok = true; Tout r = calc(t, ok); if (ok) { mutex_l.lock(); last = r; mutex_l.unlock(); cnt++; +// next_overload = true; calculated(r, &next_overload); } }