diff options
author | David Robillard <d@drobilla.net> | 2013-02-04 00:54:25 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-02-04 00:54:25 +0000 |
commit | 46c3a486eee4b2ef69d9cc4f9e2701082c64d7c8 (patch) | |
tree | ecf7a89fb1c28a619106dd78ccd257a1ff52c70a /src/gui/ThreadedLoader.cpp | |
parent | 69f98d63f5bd22c82208fef5fbc2a61613541bd7 (diff) | |
download | ingen-46c3a486eee4b2ef69d9cc4f9e2701082c64d7c8.tar.gz ingen-46c3a486eee4b2ef69d9cc4f9e2701082c64d7c8.tar.bz2 ingen-46c3a486eee4b2ef69d9cc4f9e2701082c64d7c8.zip |
Replace Raul::thread with std::thread.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5047 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/ThreadedLoader.cpp')
-rw-r--r-- | src/gui/ThreadedLoader.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp index 597a728d..5c33c1de 100644 --- a/src/gui/ThreadedLoader.cpp +++ b/src/gui/ThreadedLoader.cpp @@ -31,14 +31,13 @@ namespace Ingen { namespace GUI { ThreadedLoader::ThreadedLoader(App& app, SPtr<Interface> engine) - : Raul::Thread() - , _app(app) + : _app(app) , _sem(0) , _engine(engine) + , _exit_flag(false) + , _thread(&ThreadedLoader::run, this) { - if (parser()) { - start(); - } else { + if (!parser()) { app.log().warn("Parser unavailable, graph loading disabled\n"); } } @@ -47,6 +46,7 @@ ThreadedLoader::~ThreadedLoader() { _exit_flag = true; _sem.post(); + _thread.join(); } SPtr<Serialisation::Parser> @@ -61,7 +61,7 @@ ThreadedLoader::parser() } void -ThreadedLoader::_run() +ThreadedLoader::run() { while (_sem.wait() && !_exit_flag) { _mutex.lock(); |