rearrange cds/gc directory
[libcds.git] / cds / gc / impl / dhp_impl.h
1 //$$CDS-header$$
2
3 #ifndef __CDS_GC_DHP_DHP_IMPL_H
4 #define __CDS_GC_DHP_DHP_IMPL_H
5
6 #include <cds/threading/model.h>
7
8 //@cond
9 namespace cds { namespace gc {
10
11     inline DHP::thread_gc::thread_gc(
12         bool    bPersistent
13         )
14         : m_bPersistent( bPersistent )
15     {
16         if ( !cds::threading::Manager::isThreadAttached() )
17             cds::threading::Manager::attachThread();
18     }
19
20     inline DHP::thread_gc::~thread_gc()
21     {
22         if ( !m_bPersistent )
23             cds::threading::Manager::detachThread();
24     }
25
26     inline DHP::Guard::Guard() CDS_NOEXCEPT
27         : Guard::base_class( cds::threading::getGC<DHP>() )
28     {}
29
30     template <size_t COUNT>
31     inline DHP::GuardArray<COUNT>::GuardArray() CDS_NOEXCEPT
32         : GuardArray::base_class( cds::threading::getGC<DHP>() )
33     {}
34
35     inline void DHP::scan()
36     {
37         cds::threading::getGC<DHP>().scan();
38     }
39
40 }} // namespace cds::gc
41 //@endcond
42
43 #endif // #ifndef __CDS_GC_DHP_DHP_IMPL_H