/*
This file is a part of libcds - Concurrent Data Structures library
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
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_URCU_DETAILS_GPT_H
/// Returns singleton instance
static general_threaded * instance()
{
- return static_cast<general_threaded *>( base_class::instance() );
+ return static_cast<general_threaded *>( base_class::instance());
}
/// Checks if the singleton is created and ready to use
static bool isUsed()
bool push_buffer( epoch_retired_ptr&& p )
{
bool bPushed = m_Buffer.push( p );
- if ( !bPushed || m_Buffer.size() >= capacity() ) {
+ if ( !bPushed || m_Buffer.size() >= capacity()) {
synchronize();
if ( !bPushed )
p.free();
static void Construct( size_t nBufferCapacity = 256 )
{
if ( !singleton_ptr::s_pRCU ) {
- std::unique_ptr< general_threaded, scoped_disposer > pRCU( new general_threaded( nBufferCapacity ) );
+ std::unique_ptr< general_threaded, scoped_disposer > pRCU( new general_threaded( nBufferCapacity ));
pRCU->m_DisposerThread.start();
singleton_ptr::s_pRCU = pRCU.release();
/// Destroys singleton object and terminates internal reclamation thread
static void Destruct( bool bDetachAll = false )
{
- if ( isUsed() ) {
+ if ( isUsed()) {
general_threaded * pThis = instance();
if ( bDetachAll )
pThis->m_ThreadList.detach_all();