[K/N][Runtime] Add a lock method to thread registry

This commit is contained in:
Ilya Matveev
2021-06-03 18:26:24 +07:00
committed by Space
parent cece652412
commit 94384ce2ca
19 changed files with 163 additions and 67 deletions
@@ -21,7 +21,7 @@ namespace {
template <typename T>
KStdVector<T> Collect(MultiSourceQueue<T>& queue) {
KStdVector<T> result;
for (const auto& element : queue.Iter()) {
for (const auto& element : queue.LockForIter()) {
result.push_back(element);
}
return result;
@@ -254,7 +254,7 @@ TEST(MultiSourceQueueTest, IterWhileConcurrentPublish) {
KStdVector<int> actualBefore;
{
auto iter = queue.Iter();
auto iter = queue.LockForIter();
while (readyCount < kThreadCount) {
}
canStart = true;