summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/progresstask.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/ui/progresstask.h b/ui/progresstask.h
index a291c439..009e2c67 100644
--- a/ui/progresstask.h
+++ b/ui/progresstask.h
@@ -88,13 +88,21 @@ class BINARYNINJAUIAPI ProgressTask: public QObject
{
Q_OBJECT
- std::atomic_bool m_canceled;
ProgressDialog* m_dialog;
std::function<void(std::function<bool(size_t, size_t)>)> m_func;
- QThread* m_thread;
+ std::thread m_thread;
+ std::mutex m_mutex;
+ std::condition_variable m_cv;
+ bool m_canceled;
+ bool m_finished;
std::exception_ptr m_exception;
+ /*!
+ Run the task function (called on the background thread)
+ */
+ void start();
+
public:
/*!
Construct a new progress task, which automatically starts running a given function
@@ -135,11 +143,6 @@ public:
*/
void setText(const QString& text);
-private Q_SLOTS:
- void start();
-
- void finish();
-
public Q_SLOTS:
/*!
Cancel the progress dialog