diff options
author | David Robillard <d@drobilla.net> | 2012-05-10 03:23:11 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-05-10 03:23:11 +0000 |
commit | da468f24388d7f0f574c6e4dd4022e05d47a9db2 (patch) | |
tree | 32e90d5fa55a35caef43cb69592286fc31c5d4f4 /src/client | |
parent | 281bbcc6a7208c28283bc9bdd521c5d6cc48a60f (diff) | |
download | ingen-da468f24388d7f0f574c6e4dd4022e05d47a9db2.tar.gz ingen-da468f24388d7f0f574c6e4dd4022e05d47a9db2.tar.bz2 ingen-da468f24388d7f0f574c6e4dd4022e05d47a9db2.zip |
Use SharedPtr references to Interfaces to keep things sane.
Fix double register when using GUI with a remote engine.
Avoid signal when writing to dead socket by using send with MSG_NOSIGNAL.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4336 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/ThreadedSigClientInterface.cpp | 74 | ||||
-rw-r--r-- | src/client/wscript | 1 |
2 files changed, 0 insertions, 75 deletions
diff --git a/src/client/ThreadedSigClientInterface.cpp b/src/client/ThreadedSigClientInterface.cpp deleted file mode 100644 index 2679724c..00000000 --- a/src/client/ThreadedSigClientInterface.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard <http://drobilla.net/> - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or any later version. - - Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include "raul/log.hpp" -#include "ingen/Patch.hpp" -#include "ingen/Plugin.hpp" -#include "ingen/Port.hpp" -#include "ingen/client/ThreadedSigClientInterface.hpp" - -using namespace std; -using namespace Raul; - -namespace Ingen { -namespace Client { - -/** Push an event (from the engine, ie 'new patch') on to the queue. - */ -void -ThreadedSigClientInterface::push_sig(Closure ev) -{ - bool success = false; - while (!success) { - success = _sigs.push(ev); - if (!success) { - warn << "Client event queue full. Waiting..." << endl; - _mutex.lock(); - _cond.wait(_mutex); - _mutex.unlock(); - warn << "Queue drained, continuing" << endl; - } - } -} - -/** Process all queued events that came from the OSC thread. - * - * This function should be called from the Gtk thread to emit signals and cause - * the connected methods to execute. - */ -bool -ThreadedSigClientInterface::emit_signals() -{ - // Process a limited number of events, to prevent locking the GTK - // thread indefinitely while processing continually arriving events - - size_t num_processed = 0; - while (!_sigs.empty() && num_processed++ < (_sigs.capacity() * 3 / 4)) { - Closure& ev = _sigs.front(); - ev(); - ev.disconnect(); - _sigs.pop(); - } - - _mutex.lock(); - _cond.broadcast(); - _mutex.unlock(); - - return true; -} - -} // namespace Client -} // namespace Ingen diff --git a/src/client/wscript b/src/client/wscript index 453bc122..c3830506 100644 --- a/src/client/wscript +++ b/src/client/wscript @@ -19,6 +19,5 @@ def build(bld): PluginModel.cpp PluginUI.cpp PortModel.cpp - ThreadedSigClientInterface.cpp ingen_client.cpp ''' |