Merge pull request #13 from mat007/cleanup

Cleanup
This commit is contained in:
Mathieu Champlon 2015-05-23 23:21:37 +02:00
commit 8c1e36ed96
3 changed files with 12 additions and 5 deletions

View file

@ -7,6 +7,13 @@
[section Changelog] [section Changelog]
[section unreleased]
Not yet released
* Fixed missing thread synchronization in mock::sequence
[endsect]
[section 1.2.7] [section 1.2.7]
Released 25 April 2015 Released 25 April 2015

View file

@ -12,7 +12,7 @@
#include "../config.hpp" #include "../config.hpp"
#include "mutex.hpp" #include "mutex.hpp"
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp> #include <boost/make_shared.hpp>
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
@ -23,7 +23,9 @@ namespace detail
class sequence_impl : private boost::noncopyable class sequence_impl : private boost::noncopyable
{ {
public: public:
sequence_impl() : mutex_( boost::make_shared< mutex >() ) {} sequence_impl()
: mutex_( boost::make_shared< mutex >() )
{}
void add( void* e ) void add( void* e )
{ {
@ -57,7 +59,6 @@ namespace detail
typedef std::vector< void* > elements_type; typedef std::vector< void* > elements_type;
elements_type elements_; elements_type elements_;
const boost::shared_ptr< mutex > mutex_; const boost::shared_ptr< mutex > mutex_;
}; };
} }

View file

@ -10,7 +10,6 @@
#define MOCK_SEQUENCE_HPP_INCLUDED #define MOCK_SEQUENCE_HPP_INCLUDED
#include "config.hpp" #include "config.hpp"
#include <boost/make_shared.hpp>
#include "detail/sequence_impl.hpp" #include "detail/sequence_impl.hpp"
namespace mock namespace mock