Add various testing and building code

This commit is contained in:
2026-07-15 17:53:54 +03:00
parent e32af66c29
commit 4f6e7ad053
4 changed files with 106 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#include "ThreadSafeQueue.h"
#include <thread>
#include <chrono>
#include <iostream>
MBFT::ThreadSafeQueue<int> q;
void a(void)
{
for (int i = 0; i < 10000; i++)
{
q.push(i);
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
}
void b(void)
{
for (int i = 0; i < 10000; i++)
{
std::cout << q.pop() << "\n";
}
}
int main(void)
{
std::thread t1(a), t2(b);
t1.join();
t2.join();
return 0;
}