diff options
| author | Comment <tim@gray.(none)> | 2013-09-30 11:51:58 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-09-30 11:51:58 +0100 |
| commit | 38edd2e78c326059209c1fd15bf1b543f5fd7a46 (patch) | |
| tree | dd31a0687e5f7f4ab32b3b7548412e3fd64eac0e /rotord/src/rendercontext.h | |
| parent | 873f295e28a20e2e774852d8d7010ff5629549b4 (diff) | |
mutex locking progress bar
Diffstat (limited to 'rotord/src/rendercontext.h')
| -rw-r--r-- | rotord/src/rendercontext.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/rotord/src/rendercontext.h b/rotord/src/rendercontext.h index 130c678..0cecf49 100644 --- a/rotord/src/rendercontext.h +++ b/rotord/src/rendercontext.h @@ -82,23 +82,25 @@ namespace Rotor { } //interrupt locking process Render_status get_render_status(const string &uid){ - //cerr<<"render status requested: "<<uid<<" status: "<<renders[uid].status<<endl; - + graph.mutex.lock(); + //cerr<<"render status requested: "<<uid<<" status: "<<renders[uid].status<<endl; + if (renders.find(uid)!=renders.end()){ if (renders[uid].status==RENDERING){ renders[uid].progress=graph.progress; } + graph.mutex.unlock(); return renders[uid]; } - else return Render_status(NOT_FOUND); + graph.mutex.unlock(); + return Render_status(NOT_FOUND); + }; private: int state; //thread only does one thing at once std::deque<Session_task> work_queue; std::unordered_map<string,Render_status> renders; - Poco::Mutex mutex; //lock for access from parent thread - std::string output_filename; std::string graph_dir; std::string media_dir; @@ -106,6 +108,8 @@ namespace Rotor { std::string graph_filename; std::string graph_body; + Poco::Mutex mutex; //lock for access from parent thread + Audio_thumbnailer *audio_thumb; Graph graph; float output_framerate; |
