mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
Adapted test for TSan #4572
This commit is contained in:
parent
41469cc874
commit
47df38f7a0
@ -1,4 +1,4 @@
|
|||||||
#include <atomic>
|
#include <mutex>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <Common/ThreadPool.h>
|
#include <Common/ThreadPool.h>
|
||||||
|
|
||||||
@ -10,8 +10,9 @@ void test()
|
|||||||
{
|
{
|
||||||
Pool pool(10, 2, 10);
|
Pool pool(10, 2, 10);
|
||||||
|
|
||||||
|
std::mutex mutex;
|
||||||
for (size_t i = 0; i < 10; ++i)
|
for (size_t i = 0; i < 10; ++i)
|
||||||
pool.schedule([]{ std::cerr << '.'; });
|
pool.schedule([&]{ std::lock_guard lock(mutex); std::cerr << '.'; });
|
||||||
pool.wait();
|
pool.wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user