Skip to content

Commit

Permalink
mutex -> boost::mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
zwizwa committed Mar 9, 2014
1 parent e8fa694 commit d3bbfcf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions pylacore.h
Expand Up @@ -16,8 +16,6 @@
#include <stdint.h>
#include <boost/shared_ptr.hpp>
#include <boost/thread/mutex.hpp>
typedef boost::mutex mutex;


/* INTERFACES */

Expand Down Expand Up @@ -133,7 +131,7 @@ class memory : public buffer {
~memory();
private:
std::list<boost::shared_ptr<chunk> > _buf;
mutex _mutex;
boost::mutex _mutex;
FILE *_log;
};

Expand Down
4 changes: 2 additions & 2 deletions saleae.cpp
Expand Up @@ -53,7 +53,7 @@ void __stdcall OnConnect( U64 device_id, GenericInterface* device_interface, voi

/* saleae class */
std::vector<saleae*> saleae::_device_map;
mutex* saleae::_device_map_mutex;
boost::mutex* saleae::_device_map_mutex;
double saleae::_default_samplerate;

saleae::saleae(U64 device_id, GenericInterface* device_interface) :
Expand All @@ -70,7 +70,7 @@ saleae::~saleae() {
void saleae::start(double samplerate) {
if (!_device_map_mutex) {
_default_samplerate = samplerate;
_device_map_mutex = new mutex();
_device_map_mutex = new boost::mutex();
DevicesManagerInterface::RegisterOnConnect( &OnConnect );
DevicesManagerInterface::RegisterOnDisconnect( &OnDisconnect );
DevicesManagerInterface::BeginConnect();
Expand Down
4 changes: 2 additions & 2 deletions saleae.h
Expand Up @@ -35,12 +35,12 @@ class saleae : public cosink, public sampler {
GenericInterface* _device_interface;
double _samplerate;
boost::shared_ptr<sink> _sink;
mutex _sink_mutex;
boost::mutex _sink_mutex;

/* Registry owns saleae instances
Never delete a saleae object, nor remove it from this list. */
static std::vector<saleae*> _device_map;
static mutex *_device_map_mutex;
static boost::mutex *_device_map_mutex;
static double _default_samplerate;
};

Expand Down

0 comments on commit d3bbfcf

Please sign in to comment.