Refactoring exponential and delay back-off strategies to avoid static data members...
[libcds.git] / test / stress / stack / stack_type.h
index 6a14e748a7f477a1d329179f5f21807e3bcd9241..a9a7350d05cf12150e758f5aa37fc2522120de27 100644 (file)
@@ -1,11 +1,11 @@
 /*
     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:
 
@@ -25,7 +25,7 @@
     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 CDSSTRESS_STACK_TYPES_H
@@ -123,7 +123,7 @@ namespace stack {
             bool pop( T& v )
             {
                 unique_lock l( m_Lock );
-                if ( !m_Impl.empty() ) {
+                if ( !m_Impl.empty()) {
                     v = m_Impl.top();
                     m_Impl.pop();
                     return true;
@@ -187,10 +187,7 @@ namespace stack {
         struct traits_Treiber_exp: public
             cds::container::treiber_stack::make_traits<
                 cds::opt::back_off<
-                    cds::backoff::exponential<
-                        cds::backoff::pause,
-                        cds::backoff::yield
-                    >
+                    cds::backoff::make_exponential_t<cds::backoff::pause, cds::backoff::yield >
                 >
             >::type
         {};
@@ -324,10 +321,7 @@ namespace stack {
             cds::container::treiber_stack::make_traits <
                 cds::opt::enable_elimination<true>
                 ,cds::opt::back_off<
-                    cds::backoff::exponential<
-                        cds::backoff::pause,
-                        cds::backoff::yield
-                    >
+                    cds::backoff::make_exponential_t< cds::backoff::pause, cds::backoff::yield >
                 >
             > ::type
         {};