Skip to content

Commit

Permalink
Block action until execution done only if executed from Python thread
Browse files Browse the repository at this point in the history
  • Loading branch information
joern274 committed Jul 17, 2024
1 parent 84308c4 commit b8af732
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions plugins/gui/src/user_action/user_action_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "gui/user_action/action_open_netlist_file.h"
#include "gui/user_action/action_unfold_module.h"
#include "gui/settings/settings_items/settings_item_checkbox.h"
#include "gui/python/python_context.h"
#include "hal_core/utilities/log.h"
#include <QTextCursor>
#include <QMessageBox>
Expand Down Expand Up @@ -39,10 +40,15 @@ namespace hal
void UserActionManager::executeActionBlockThread(UserAction *act)
{
if (!act) return;
mMutex.lock();
mThreadedAction = act;
Q_EMIT triggerExecute();
mMutex.unlock();
if (dynamic_cast<PythonThread*>(QThread::currentThread()))
{
mMutex.lock();
mThreadedAction = act;
Q_EMIT triggerExecute();
mMutex.unlock();
}
else
act->exec();
}

void UserActionManager::handleTriggerExecute()
Expand Down

0 comments on commit b8af732

Please sign in to comment.