mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'gfx-work' into sim
This commit is contained in:
12
PyInt.cpp
12
PyInt.cpp
@@ -10,10 +10,10 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "PyInt.h"
|
||||
|
||||
#include "Globals.h"
|
||||
#include "dictionary.h"
|
||||
#include "application.h"
|
||||
#include "renderer.h"
|
||||
#include "Logs.h"
|
||||
#include "Globals.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
||||
@@ -141,6 +141,11 @@ auto python_taskqueue::init() -> bool {
|
||||
Py_SetPythonHome("linuxpython64");
|
||||
else
|
||||
Py_SetPythonHome("linuxpython");
|
||||
#elif __APPLE__
|
||||
if (sizeof(void*) == 8)
|
||||
Py_SetPythonHome("macpython64");
|
||||
else
|
||||
Py_SetPythonHome("macpython");
|
||||
#endif
|
||||
Py_Initialize();
|
||||
PyEval_InitThreads();
|
||||
@@ -209,7 +214,8 @@ void python_taskqueue::exit() {
|
||||
m_condition.notify_all();
|
||||
// let them free up their shit before we proceed
|
||||
for( auto &worker : m_workers ) {
|
||||
worker.join();
|
||||
if (worker.joinable())
|
||||
worker.join();
|
||||
}
|
||||
// get rid of the leftover tasks
|
||||
// with the workers dead we don't have to worry about concurrent access anymore
|
||||
|
||||
Reference in New Issue
Block a user