pthread patch, need test

git-svn-id: svn://db.shs.com.ru/pip@887 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2020-02-26 13:07:05 +00:00
parent 3c252bbeae
commit 9b2be3333b
3 changed files with 3 additions and 7 deletions

View File

@@ -1,7 +1,3 @@
//
// Created by fomenko on 20.09.2019.
//
#ifndef PIP_TESTS_PIBLOCKINGDEQUEUE_H
#define PIP_TESTS_PIBLOCKINGDEQUEUE_H
@@ -187,7 +183,7 @@ public:
mutex.lock();
other.mutex.lock();
size_t count = maxCount > PIDeque<T>::size() ? PIDeque<T>::size() : maxCount;
size_t otherRemainingCapacity = other.max_size - static_cast<PIDeque<T>>(other).size();
size_t otherRemainingCapacity = other.max_size - static_cast<PIDeque<T> >(other).size();
if (count > otherRemainingCapacity) count = otherRemainingCapacity;
for (size_t i = 0; i < count; ++i) other.push_back(PIDeque<T>::take_front());
other.mutex.unlock();