Files
concurrency-in-action/source/listing_3.4.cpp
2018-10-18 00:40:34 -05:00

25 lines
447 B
C++

#include <exception>
#include <memory>
struct empty_stack : std::exception {
const char* what() const throw();
};
template <typename T>
class threadsafe_stack {
public:
threadsafe_stack();
threadsafe_stack(const threadsafe_stack&);
threadsafe_stack& operator=(const threadsafe_stack&) = delete;
void push(T new_value);
std::shared_ptr<T> pop();
void pop(T& value);
bool empty() const;
};
int
main()
{
}