2011.01.02 khizmax Created
*/
+#include <stdlib.h>
+#include <mutex> // unique_lock
#include <cds/init.h>
#include <cds/memory/michael/options.h>
#include <cds/memory/michael/bound_check.h>
#include <cds/user_setup/cache_line.h>
#include <cds/details/lib.h>
-#include <stdlib.h>
#include <boost/intrusive/list.hpp>
namespace cds {
}
};
#endif
-
- typedef container::VyukovMPMCCycleQueue<
- void *,
- opt::buffer< opt::v::static_buffer<void *, FreeListCapacity> >
+ struct free_list_traits : public cds::container::vyukov_queue::traits
+ {
+ typedef opt::v::static_buffer<void *, FreeListCapacity> buffer;
#ifdef _DEBUG
- , opt::value_cleaner< make_null_ptr >
+ typedef make_null_ptr value_cleaner;
#endif
- > free_list;
+ };
+ typedef container::VyukovMPMCCycleQueue< void *, free_list_traits > free_list;
free_list m_FreeList;
//@endcond
typedef details::free_list_locked_hook item_hook;
typedef Lock lock_type;
protected:
- typedef cds::lock::scoped_lock<lock_type> auto_lock;
+ typedef std::unique_lock<lock_type> auto_lock;
mutable lock_type m_access;
//@endcond
typedef details::partial_list_locked_hook item_hook;
typedef Lock lock_type;
protected:
- typedef cds::lock::scoped_lock<lock_type> auto_lock;
+ typedef std::unique_lock<lock_type> auto_lock;
mutable lock_type m_access;
//@endcond
, nCredits(0)
{}
-# ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
- active_tag( active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
- ~active_tag() CDS_NOEXCEPT_DEFAULTED = default;
- active_tag& operator=(active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
-# if defined(CDS_MOVE_SEMANTICS_SUPPORT) && !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
- active_tag( active_tag&& ) CDS_NOEXCEPT_DEFAULTED = default;
- active_tag& operator=(active_tag&&) CDS_NOEXCEPT_DEFAULTED = default;
+ active_tag( active_tag const& ) CDS_NOEXCEPT = default;
+ ~active_tag() CDS_NOEXCEPT = default;
+ active_tag& operator=(active_tag const& ) CDS_NOEXCEPT = default;
+# if !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
+ active_tag( active_tag&& ) CDS_NOEXCEPT = default;
+ active_tag& operator=(active_tag&&) CDS_NOEXCEPT = default;
# endif
-# endif
/// Returns pointer to superblock descriptor
superblock_desc * ptr() const
active_tag() CDS_NOEXCEPT
: pDesc( nullptr )
{}
-# ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
// Clang 3.1: error: first argument to atomic operation must be a pointer to a trivially-copyable type
- //active_tag() CDS_NOEXCEPT_DEFAULTED = default;
- active_tag( active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
- ~active_tag() CDS_NOEXCEPT_DEFAULTED = default;
- active_tag& operator=(active_tag const&) CDS_NOEXCEPT_DEFAULTED = default;
-# if defined(CDS_MOVE_SEMANTICS_SUPPORT) && !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
- active_tag( active_tag&& ) CDS_NOEXCEPT_DEFAULTED = default;
- active_tag& operator=(active_tag&&) CDS_NOEXCEPT_DEFAULTED = default;
+ //active_tag() CDS_NOEXCEPT = default;
+ active_tag( active_tag const& ) CDS_NOEXCEPT = default;
+ ~active_tag() CDS_NOEXCEPT = default;
+ active_tag& operator=(active_tag const&) CDS_NOEXCEPT = default;
+# if !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
+ active_tag( active_tag&& ) CDS_NOEXCEPT = default;
+ active_tag& operator=(active_tag&&) CDS_NOEXCEPT = default;
# endif
-# endif
superblock_desc * ptr() const
{
return pDesc.ptr();
/// Allocates new processor descriptor
processor_desc * new_processor_desc( unsigned int nProcessorId )
{
+ CDS_UNUSED( nProcessorId );
processor_desc * pDesc;
const size_t nPageHeapCount = m_SizeClassSelector.pageTypeCount();