ci: Add Rust to Nix docker image (#7571)

This commit is contained in:
Sergey Kuznetsov
2026-07-14 14:28:55 +01:00
committed by GitHub
parent ab3ff66cd9
commit 2e25435a4a
17 changed files with 209 additions and 15 deletions

View 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;
}