// Collect a set of signals
map<shared_ptr<Channel>, shared_ptr<Signal> > signal_map;
- shared_lock<shared_mutex> lock(session_.signals_mutex());
- const unordered_set< shared_ptr<Signal> > &sigs(session_.signals());
+ const unordered_set< shared_ptr<Signal> > sigs(session_.signals());
for (const shared_ptr<Signal> &sig : sigs)
signal_map[sig->channel()] = sig;
return data;
}
-boost::shared_mutex& Session::signals_mutex() const
-{
- return signals_mutex_;
-}
-
-const unordered_set< shared_ptr<view::Signal> >& Session::signals() const
+const unordered_set< shared_ptr<view::Signal> > Session::signals() const
{
+ shared_lock<shared_mutex> lock(signals_mutex_);
return signals_;
}
std::set< std::shared_ptr<data::SignalData> > get_data() const;
- boost::shared_mutex& signals_mutex() const;
-
- const std::unordered_set< std::shared_ptr<view::Signal> >&
+ const std::unordered_set< std::shared_ptr<view::Signal> >
signals() const;
#ifdef ENABLE_DECODE
bool StoreSession::start()
{
- shared_lock<shared_mutex> lock(session_.signals_mutex());
- const unordered_set< shared_ptr<view::Signal> > &sigs(session_.signals());
+ const unordered_set< shared_ptr<view::Signal> > sigs(session_.signals());
// Add enabled channels to the data set
set< shared_ptr<data::SignalData> > data_set;
{
assert(dec);
- shared_lock<shared_mutex> lock(session_.signals_mutex());
- const auto &sigs(session_.signals());
+ const auto sigs(session_.signals());
vector< shared_ptr<Signal> > sig_list(sigs.begin(), sigs.end());
std::sort(sig_list.begin(), sig_list.end(),
map<const srd_channel*, shared_ptr<LogicSignal> > channel_map;
- shared_lock<shared_mutex> lock(session_.signals_mutex());
- const unordered_set< shared_ptr<Signal> > &sigs(session_.signals());
+ const unordered_set< shared_ptr<Signal> > sigs(session_.signals());
for (const ChannelSelector &s : channel_selectors_)
{
#include <type_traits>
#include <vector>
-#ifdef _WIN32
-// Windows: Avoid namespace pollution by thread.hpp (which includes windows.h).
-#define NOGDI
-#define NORESOURCE
-#endif
-#include <boost/thread/locks.hpp>
-#include <boost/thread/shared_mutex.hpp>
-
#include <pv/session.hpp>
namespace pv {
public:
RowItemIterator(Owner *owner) :
- owner_(owner),
- lock_(owner->session().signals_mutex()) {}
+ owner_(owner) {}
RowItemIterator(Owner *owner, child_iterator iter) :
- owner_(owner),
- lock_(owner->session().signals_mutex()) {
+ owner_(owner) {
assert(owner);
if (iter != owner->child_items().end())
iter_stack_.push(iter);
RowItemIterator(const RowItemIterator<Owner, Item> &o) :
owner_(o.owner_),
- lock_(*o.lock_.mutex()),
iter_stack_(o.iter_stack_) {}
reference operator*() const {
private:
Owner *owner_;
- boost::shared_lock<boost::shared_mutex> lock_;
std::stack<child_iterator> iter_stack_;
};
set< shared_ptr<SignalData> > View::get_visible_data() const
{
- shared_lock<shared_mutex> lock(session().signals_mutex());
- const unordered_set< shared_ptr<Signal> > &sigs(session().signals());
+ const unordered_set< shared_ptr<Signal> > sigs(session().signals());
// Make a set of all the visible data objects
set< shared_ptr<SignalData> > visible_data;
{
// Check whether we know the sample rate and hence can use time as the unit
if (time_unit_ == util::TimeUnit::Samples) {
- shared_lock<shared_mutex> lock(session().signals_mutex());
- const unordered_set< shared_ptr<Signal> > &sigs(session().signals());
+ const unordered_set< shared_ptr<Signal> > sigs(session().signals());
// Check all signals but...
for (const shared_ptr<Signal> signal : sigs) {
const set<shared_ptr<Trace>> prev_traces(
prev_trace_list.begin(), prev_trace_list.end());
- shared_lock<shared_mutex> lock(session_.signals_mutex());
- const unordered_set< shared_ptr<Signal> > &sigs(session_.signals());
+ const unordered_set< shared_ptr<Signal> > sigs(session_.signals());
set< shared_ptr<Trace> > traces(sigs.begin(), sigs.end());