Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSLIB_GC_IMPL_DHP_IMPL_H
namespace dhp {
- inline Guard::Guard()
- {
- cds::threading::getGC<DHP>().allocGuard( *this );
- }
-
- inline Guard::~Guard()
+ static inline ThreadGC& get_thread_gc()
{
- cds::threading::getGC<DHP>().freeGuard( *this );
+ return cds::threading::getGC<DHP>();
}
- template <size_t Count>
- inline GuardArray<Count>::GuardArray()
- {
- cds::threading::getGC<DHP>().allocGuard( *this );
- }
-
- template <size_t Count>
- inline GuardArray<Count>::~GuardArray()
- {
- cds::threading::getGC<DHP>().freeGuard( *this );
- }
+ //inline Guard::Guard()
+ //{
+ // cds::threading::getGC<DHP>().allocGuard( *this );
+ //}
+
+ //inline Guard::~Guard()
+ //{
+ // cds::threading::getGC<DHP>().freeGuard( *this );
+ //}
+
+ //template <size_t Count>
+ //inline GuardArray<Count>::GuardArray()
+ //{
+ // cds::threading::getGC<DHP>().allocGuard( *this );
+ //}
+
+ //template <size_t Count>
+ //inline GuardArray<Count>::~GuardArray()
+ //{
+ // cds::threading::getGC<DHP>().freeGuard( *this );
+ //}
} // namespace dhp
)
: m_bPersistent( bPersistent )
{
- if ( !cds::threading::Manager::isThreadAttached() )
+ if ( !cds::threading::Manager::isThreadAttached())
cds::threading::Manager::attachThread();
}
cds::threading::Manager::detachThread();
}
- inline /*static*/ void DHP::thread_gc::alloc_guard( cds::gc::dhp::details::guard& g )
+ inline /*static*/ dhp::details::guard_data* DHP::thread_gc::alloc_guard()
+ {
+ return dhp::get_thread_gc().allocGuard();
+ }
+ inline /*static*/ void DHP::thread_gc::free_guard( dhp::details::guard_data* g )
{
- return cds::threading::getGC<DHP>().allocGuard(g);
+ if ( g )
+ dhp::get_thread_gc().freeGuard( g );
}
- inline /*static*/ void DHP::thread_gc::free_guard( cds::gc::dhp::details::guard& g )
+
+ template <size_t Count>
+ inline DHP::GuardArray<Count>::GuardArray()
+ {
+ dhp::get_thread_gc().allocGuard( m_arr );
+ }
+
+ template <size_t Count>
+ inline DHP::GuardArray<Count>::~GuardArray()
{
- cds::threading::getGC<DHP>().freeGuard(g);
+ dhp::get_thread_gc().freeGuard( m_arr );
}
inline void DHP::scan()