2 #include <cds/gc/dhp.h>
3 #include <cds/intrusive/treiber_stack.h>
9 namespace ci = cds::intrusive;
10 typedef cds::gc::HP gc;
12 struct Foo : public ci::treiber_stack::node<gc> {
17 struct MyTraits : public cds::intrusive::treiber_stack::traits {
18 typedef cds::intrusive::treiber_stack::stat<> stat;
21 // Equivalent make_traits example:
22 typedef cds::intrusive::TreiberStack<cds::gc::HP, Foo> MyStack;
28 // Initialize Hazard Pointer singleton
29 cds::gc::HP hpGC(128, 8, 128);
30 // If main thread uses lock-free containers
31 // the main thread should be attached to libcds infrastructure
32 cds::threading::Manager::attachThread();
40 cout << "Pop " << res->x << "\n";