if (!server_found (ip) && xml->optional_number_child<int>("Version").get_value_or (0) == SERVER_LINK_VERSION) {
ServerDescription sd (ip, xml->number_child<int> ("Threads"));
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm (_servers_mutex);
_servers.push_back (sd);
}
emit (boost::bind (boost::ref (ServersListChanged)));
bool
ServerFinder::server_found (string ip) const
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm (_servers_mutex);
list<ServerDescription>::const_iterator i = _servers.begin();
while (i != _servers.end() && i->host_name() != ip) {
++i;
list<ServerDescription>
ServerFinder::servers () const
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm (_servers_mutex);
return _servers;
}
{
if (what == Config::USE_ANY_SERVERS || what == Config::SERVERS) {
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm (_servers_mutex);
_servers.clear ();
}
ServersListChanged ();
boost::thread* _listen_thread;
std::list<ServerDescription> _servers;
- mutable boost::mutex _mutex;
+ mutable boost::mutex _servers_mutex;
boost::asio::io_service _listen_io_service;
boost::shared_ptr<boost::asio::ip::tcp::acceptor> _listen_acceptor;
void
Writer::write (Data encoded, int frame, Eyes eyes)
{
- boost::mutex::scoped_lock lock (_mutex);
+ boost::mutex::scoped_lock lock (_state_mutex);
while (_queued_full_in_memory > _maximum_frames_in_memory) {
/* The queue is too big; wait until that is sorted out */
void
Writer::repeat (int frame, Eyes eyes)
{
- boost::mutex::scoped_lock lock (_mutex);
+ boost::mutex::scoped_lock lock (_state_mutex);
while (_queued_full_in_memory > _maximum_frames_in_memory) {
/* The queue is too big; wait until that is sorted out */
void
Writer::fake_write (int frame, Eyes eyes)
{
- boost::mutex::scoped_lock lock (_mutex);
+ boost::mutex::scoped_lock lock (_state_mutex);
while (_queued_full_in_memory > _maximum_frames_in_memory) {
/* The queue is too big; wait until that is sorted out */
{
while (true)
{
- boost::mutex::scoped_lock lock (_mutex);
+ boost::mutex::scoped_lock lock (_state_mutex);
while (true) {
void
Writer::terminate_thread (bool can_throw)
{
- boost::mutex::scoped_lock lock (_mutex);
+ boost::mutex::scoped_lock lock (_state_mutex);
if (_thread == 0) {
return;
}
/** number of FULL frames whose JPEG200 data is currently held in RAM */
int _queued_full_in_memory;
/** mutex for thread state */
- mutable boost::mutex _mutex;
+ mutable boost::mutex _state_mutex;
/** condition to manage thread wakeups when we have nothing to do */
boost::condition _empty_condition;
/** condition to manage thread wakeups when we have too much to do */