mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-02 16:26:48 +00:00
ci: Check binaries separately from building them (#7355)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
28
docker/test_files/cpp_sources/regular.cpp
Normal file
28
docker/test_files/cpp_sources/regular.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <iostream>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
static std::mutex gMutex;
|
||||
|
||||
void
|
||||
worker(int id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(gMutex);
|
||||
std::cout << "Hello from thread " << id << "\n";
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
constexpr int kNumThreads = 10;
|
||||
std::vector<std::thread> threads;
|
||||
threads.reserve(kNumThreads);
|
||||
for (int i = 0; i < kNumThreads; ++i)
|
||||
threads.emplace_back(worker, i);
|
||||
for (auto& t : threads)
|
||||
t.join();
|
||||
|
||||
std::cout << "Hello from main thread\n";
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user