16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 04:19:19 +02:00

build fixes, bump version, don't duplicate screen render requests

This commit is contained in:
milek7
2018-10-12 23:19:38 +02:00
parent c7741c6618
commit 047988219b
4 changed files with 14 additions and 4 deletions

View File

@@ -160,6 +160,18 @@ auto python_taskqueue::insert( task_request const &Task ) -> bool {
// acquire a lock on the task queue and add a new task
{
std::lock_guard<std::mutex> lock( m_tasks.mutex );
// if task for this target already exists, don't add another
for (render_task *task : m_tasks.data)
if (task->get_target() == Task.target)
{
PyEval_AcquireLock();
Py_DECREF(Task.input);
PyEval_ReleaseLock();
return false;
}
m_tasks.data.emplace_back( new render_task( renderer, Task.input, Task.target ) );
}
// potentially wake a worker to handle the new task