Skip to content

Commit

Permalink
Merge pull request #50 from boostorg/develop
Browse files Browse the repository at this point in the history
Merge 'develop' to 'master'
  • Loading branch information
timblechmann committed May 2, 2019
2 parents 38f0cfc + 7e23dac commit fbea9be
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 117 deletions.
203 changes: 95 additions & 108 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,120 +1,107 @@
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Copyright Rene Rivera 2015-2016.
# Copyright Tim Blechmann 2018

# Setting up notifications like this is optional as the default behavior
# of Travis is to notify the commiter of problems. But setting a specific
# recipient this way ensures you get all the communications about the
# builds.
notifications:
email:
recipients:
- tim@klingt.org
# Copyright 2016-2018 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)

language: cpp

sudo: false

# For now the CI scripts only support the two main branches available
# on the boost super-project.
branches:
only:
- master
- develop
- /feature\/.*/

# We specify a generic language instead of C++ as Travis sets up
# additional environment vars that point to its default toolset
# instead of the one we install. The extra env doesn't interfere,
# but at the same time it's misleading. So to avoid confusion and
# possible unseen side effects we stick with no C++ default setup.
language: generic

# Speficy the default as Linux here, to avoid duplication in the matrix
# below. We use Trausty as that's the latest we can use. And it's better
# supported by the whole range of C++ toolsets we like to test on.
dist: trusty
os: linux

# Because we install our own toolsets and other software we need
# to run the sudo support.
sudo: required

# Travis has a long standing bug with their rather complicated
# build matrix evaluation that causes empty jobs to be created.
# This global matrix entry in combination with the exclusion
# below works around that bug. This is the suggested fix from
# the Travis support people.
env:
matrix:
- TRAVIS_EMPTY_JOB_WORKAROUND=true
- BOGUS_JOB=true

# This lists all the toolsets we will test with the Boost CI
# scripts. Predef needs to check all of them as its job is to
# distiguish between all of them. For other libraries you would
# want to limit the list to the toolsets that are important
# for that.
matrix:

exclude:
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
- env: BOGUS_JOB=true

include:
- env: TOOLSET=clang-3.4
- env: TOOLSET=clang-3.5
- env: TOOLSET=clang-3.6
- env: TOOLSET=clang-3.7
- env: TOOLSET=clang-3.8
- env: TOOLSET=clang-3.9
- env: TOOLSET=clang-4.0 CXXFLAGS=-std=c++03
- env: TOOLSET=clang-4.0 CXXFLAGS=-std=c++11
- env: TOOLSET=clang-4.0 CXXFLAGS=-std=c++14
- env: TOOLSET=clang-4.0 CXXFLAGS=-std=c++1z
- env: TOOLSET=gcc-4.7
- env: TOOLSET=gcc-4.8
- env: TOOLSET=gcc-4.9
- env: TOOLSET=gcc-5
- env: TOOLSET=gcc-6
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++03
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++11
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++14
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++1z
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++03
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++11
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++14
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++1z
- env: TOOLSET=xcode-6.1
os: osx
- env: TOOLSET=xcode-6.4
os: osx
osx_image: xcode6.4
- env: TOOLSET=xcode-7.3
os: osx
osx_image: xcode7.3
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++03
os: osx
osx_image: xcode8.3
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++11
os: osx
osx_image: xcode8.3
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++14
os: osx
osx_image: xcode8.3
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++1z
os: osx
osx_image: xcode8.3

# These are the standard steps to bootstrap the Boost CI scripts
# and to forward the actions to the scripts.
before_install:
# Fetch the scripts to do the actual building/testing.
- |
wget "https://raw.githubusercontent.com/boostorg/regression/develop/ci/src/ci_boost_common.py" -P ..
wget "https://raw.githubusercontent.com/boostorg/regression/develop/ci/src/ci_boost_library_test.py" -P ..
install: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" install
before_script: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" before_script
script: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" script
before_cache: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" before_cache
after_success: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" after_success
after_failure: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" after_failure
after_script: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" after_script
cache:
directories:
- $HOME/boostorg/boost
- os: linux
compiler: g++
env: TOOLSET=gcc CXXSTD=03,11

- os: linux
compiler: g++-5
env: TOOLSET=gcc CXXSTD=03,11,14,1z
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test

- os: linux
compiler: g++-6
env: TOOLSET=gcc CXXSTD=03,11,14,1z
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test

- os: linux
compiler: g++-7
env: TOOLSET=gcc CXXSTD=03,11,14,17
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test

- os: linux
compiler: g++-8
env: TOOLSET=gcc CXXSTD=03,11,14,17
addons:
apt:
packages:
- g++-8
sources:
- ubuntu-toolchain-r-test

- os: linux
compiler: clang++
env: TOOLSET=clang CXXSTD=03,11,14,1z

- os: linux
compiler: clang++-libc++
env: TOOLSET=clang CXXSTD=03,11,14,1z
addons:
apt:
packages:
- libc++-dev

- os: osx
compiler: clang++
env: TOOLSET=clang CXXSTD=03,11,14,1z

install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..
- git clone -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/boost_install
- git submodule update --init libs/headers
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/lockfree
- python tools/boostdep/depinst/depinst.py lockfree
- ./bootstrap.sh
- ./b2 headers

script:
- |-
echo "using $TOOLSET : : $TRAVIS_COMPILER ;" > ~/user-config.jam
- ./b2 -j3 libs/lockfree/test toolset=$TOOLSET cxxstd=$CXXSTD

notifications:
email:
on_success: always
2 changes: 1 addition & 1 deletion include/boost/lockfree/policies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef BOOST_LOCKFREE_POLICIES_HPP_INCLUDED
#define BOOST_LOCKFREE_POLICIES_HPP_INCLUDED

#include <boost/parameter/aux_/template_keyword.hpp>
#include <boost/parameter/template_keyword.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/size_t.hpp>

Expand Down
2 changes: 1 addition & 1 deletion include/boost/lockfree/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class queue
typedef typename detail::select_tagged_handle<node, node_based>::handle_type handle_type;

node(T const & v, handle_type null_handle):
data(v)//, next(tagged_node_handle(0, 0))
next(tagged_node_handle(null_handle, 0)), data(v)
{
/* increment tag to avoid ABA problem */
tagged_node_handle old_next = next.load(memory_order_relaxed);
Expand Down
8 changes: 5 additions & 3 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

import testing ;

lib boost_unit_test_framework ;
lib boost_thread ;
lib boost_chrono ;
lib boost_interprocess ;
lib boost_system ;
lib boost_thread ;
lib boost_unit_test_framework ;

project
: source-location .
: requirements
<hardcode-dll-paths>true
<library>../../test/build//boost_unit_test_framework
<library>../../atomic/build//boost_atomic
;
Expand All @@ -33,6 +34,7 @@ rule test_all
<host-os>hpux,<toolset>gcc:<linkflags>"-Wl,+as,mpas"
<library>../../thread/build//boost_thread/
<threading>multi
<link>static
] ;
}

Expand Down
4 changes: 4 additions & 0 deletions test/freelist_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ struct freelist_tester

if (running.load() == false)
break;

#ifdef __VXWORKS__
boost::thread::yield();
#endif
}

dummy * node;
Expand Down
11 changes: 11 additions & 0 deletions test/spsc_queue_stress_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ struct spsc_queue_tester

boost::lockfree::detail::atomic<long> spsc_queue_cnt, received_nodes;

// In VxWorks one RTP just supports 65535 objects
#ifndef __VXWORKS__
static_hashed_set<int, 1<<16 > working_set;
#else
static_hashed_set<int, 1<<15 > working_set;
#endif

spsc_queue_tester(void):
spsc_queue_cnt(0), received_nodes(0)
Expand Down Expand Up @@ -118,7 +123,13 @@ struct spsc_queue_tester_buffering

boost::lockfree::detail::atomic<long> spsc_queue_cnt;

// In VxWorks one RTP just supports 65535 objects
#ifndef __VXWORKS__
static_hashed_set<int, 1<<16 > working_set;
#else
static_hashed_set<int, 1<<15 > working_set;
#endif

boost::lockfree::detail::atomic<size_t> received_nodes;

spsc_queue_tester_buffering(void):
Expand Down
18 changes: 14 additions & 4 deletions test/test_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,17 @@ struct queue_stress_tester
assert(inserted);

if (Bounded)
while(stk.bounded_push(id) == false)
/*thread::yield()*/;
while(stk.bounded_push(id) == false) {
#ifdef __VXWORKS__
thread::yield();
#endif
}
else
while(stk.push(id) == false)
/*thread::yield()*/;
while(stk.push(id) == false) {
#ifdef __VXWORKS__
thread::yield();
#endif
}
++push_count;
}
writers_finished += 1;
Expand Down Expand Up @@ -90,6 +96,10 @@ struct queue_stress_tester

if ( writers_finished.load() == writer_threads )
break;

#ifdef __VXWORKS__
thread::yield();
#endif
}

while (consume_element(q));
Expand Down

0 comments on commit fbea9be

Please sign in to comment.