摘要:
template<typename T> class threadsafe_list { struct node // 1 { std::mutex m; std::shared_ptr<T> data; std::unique_ptr<node> next; node(): // 2 next() 阅读全文
posted @ 2024-04-02 17:53
fchy822
阅读(15)
评论(0)
推荐(0)
摘要:
#include <iostream> #include <mutex> #include <condition_variable> #include <thread> template<typename T> class ThreadSafeQueue { private: struct Node 阅读全文
posted @ 2024-04-02 16:18
fchy822
阅读(34)
评论(0)
推荐(0)
摘要:
class ThreadSafeLinkedStack { private: struct Node { T data; std::shared_ptr<Node> next; Node(T data) : data(data), next(nullptr) {} }; std::shared_pt 阅读全文
posted @ 2024-04-02 10:49
fchy822
阅读(14)
评论(0)
推荐(0)
浙公网安备 33010602011771号