Mat Sutcliffe
d7a461ff7a
Use if constexpr (C++17 feature)
2021-07-13 17:56:30 +01:00
Mat Sutcliffe
5d67cd9f68
Use _v traits variable aliases (C++17 feature)
2021-07-13 17:56:29 +01:00
Mat Sutcliffe
371c1f4f7c
Issue #77 Break cyclic dependency between CLogCategory and numerous classes
2020-12-19 18:50:34 +00:00
Mat Sutcliffe
63e8de8f00
Issue #77 getLogCategories returns a simple QStringList instead of our own class
2020-12-19 18:50:34 +00:00
Mat Sutcliffe
1c8fd1b47e
Issue #77 Break dependency of worker on variant
2020-08-29 22:46:28 +01:00
Mat Sutcliffe
479210957a
Issue #77 Break dependency of worker on identifiable
2020-08-29 14:16:19 +01:00
Mat Sutcliffe
9e0ebef5a1
Issue #77 Move singleShot from worker.h to threadutils.h
2020-08-29 14:16:18 +01:00
Mat Sutcliffe
6aa9f0cc25
Issue #15 Created CPromise, a way to set the result of QFuture objects
...
This enables several new features:
* singleShot can return a QFuture.
* a version of invokeMethod that returns a QFuture.
* CGenericDBusInterface::callDBusFuture, which returns a QFuture.
2020-08-01 13:18:55 +01:00
Mat Sutcliffe
2f1e3f47f9
Track worker construction and destruction
...
Added debug log messages in case a worker still exists when the `qApp` is destroyed.
This would mean that a `quitAndWait` is missing or is being skipped somewhere.
2020-06-12 18:42:41 +01:00
Klaus Basan
1da66ce6e9
[Worker] Stop timer in correct thread
2020-06-12 18:42:38 +01:00
Klaus Basan
b0d5b3c6d1
[Worker] Log. how long it takes to quitAndWait a worker
...
* sometimes the shutdown sequence of swift takes extremly long, this is to identify which workers are affected
* reduced "wait time"
* function so each worker can have its own "wait" time
* for a worker there are 2 "waits", the quitAndWait of the worker and the wait of CRegularThread (dtor)
Originally Ref T145, T647
2020-06-12 18:42:35 +01:00
Klaus Basan
9bbc993a62
Ref T730, make owner of thread available (ASSERT checks etc.)
2019-10-11 19:00:44 +01:00
Mat Sutcliffe
e9a4c49d68
Ref T547 Update license masthead in all source code files.
2019-02-22 20:36:43 +00:00
Klaus Basan
9c3ae527aa
Ref T521, removed CWorkerPointer as discussed MS/KB
2019-02-22 20:35:38 +00:00
Mat Sutcliffe
bd9948bbff
Ref T486 Using QMetaObject::invokeMethod with pointer-to-member-function (or functor).
2019-02-22 20:34:53 +00:00
Mat Sutcliffe
9f85a7b560
Fixed clazy warnings: pass large objects by reference to const.
2019-02-22 20:23:33 +00:00
Mat Sutcliffe
e40af8132c
Fixed clazy warnings: missing Q_OBJECT.
2019-02-22 20:23:33 +00:00
Mat Sutcliffe
917214c499
Ref T414 Use a promise/future pair in CWorker::thenWithResult
...
to avoid accessing the worker after it was potentially destroyed.
2018-11-04 17:42:46 +01:00
Mat Sutcliffe
cf92fbeb03
Worker task wrapper lambda needs to be mutable so its captured task can be moved from properly.
2018-11-04 17:42:46 +01:00
Mat Sutcliffe
cf5a807bc6
Ref T405 Follow-up: mutex needs to remain locked when signal is emitted,
...
to guarantee continuations are called only once when worker finishes.
2018-11-04 17:42:46 +01:00
Mat Sutcliffe
46def05670
Ref T405 Guard against recursive locks on CWorkerBase::m_finishedMutex.
2018-11-04 17:42:42 +01:00
Mat Sutcliffe
c98454ff8a
Ref T314 Style.
2018-10-05 17:39:56 +02:00
Klaus Basan
d37c52fed5
Ref T315, owner is normal pointer, disucssion:
...
- https://swift-project.slack.com/archives/GCKMFLG30/p1536331871000100
- and in comments of T315
2018-09-09 02:55:14 +02:00
Klaus Basan
5096df034b
Ref T314, thread CContinuousWorker::finish
...
- use application thread if there is no owner
- use QPointer for owner
- more detailled error message
2018-08-31 20:08:06 +02:00
Klaus Basan
956ffd949d
Style
2018-08-26 15:26:49 +02:00
Klaus Basan
d6fd53287f
Improved graceful shutdown, added "m_shutdownInProgress"
...
* no assert when wait is called in same thread, just ignore wait
* quitAndWait readers, also works if not already noved in new thread (see above)
2018-04-13 23:36:49 +02:00
Klaus Basan
8324c2d305
Ref T160, continous worker now CIdentifiable and name is mandatory
2017-09-25 05:23:57 +02:00
Klaus Basan
ec77f9c64b
Ref T160, further formatting
2017-09-25 05:23:57 +02:00
Klaus Basan
c0a6574c80
Ref T148, public getName so it can be used in logging
2017-09-24 19:54:04 +01:00
Klaus Basan
4a7ad09e46
Ref T105, m_updateTimer as protected member of CContinuousWorker
...
* stop timer
* default cleanup implementation
* set timer name
2017-09-24 19:50:14 +01:00
Klaus Basan
7f3643fb0e
Ref T105, use enabled in CContinuousWorker
...
* removed slots
* getName
2017-09-24 19:50:06 +01:00
Mathew Sutcliffe
7d7ce055ef
T102 Implement move constructor and move assignment for CWorkerPointer
...
so the connection to the worker's aboutToStart signal remains valid.
2017-09-24 19:49:34 +01:00
Mathew Sutcliffe
a37b12c8bc
T102 Fixed mistake that caused CWorkerPointer to delete the worker
...
immediately as soon as it starts.
2017-09-24 19:49:33 +01:00
Mathew Sutcliffe
fdbfda848f
T102 Don't try to wait for a worker to finish while holding a lock
...
on the mutex that protects its finished flag, as it will deadlock.
2017-09-24 19:49:31 +01:00
Mathew Sutcliffe
41ff563e19
T66 A new smart pointer for managing a CContinuousWorker subclass instance.
...
Owns the worker before it starts, when ownership is transferred to the thread.
2017-05-14 17:21:34 +01:00
Mathew Sutcliffe
ca81c65eae
T66 CContinuousWorker tracks whether it has been started,
...
and when starting checks that it was not already started.
2017-05-14 17:21:33 +01:00
Mathew Sutcliffe
969c077182
Fixed possible memory leak in BlackMisc::singleShot.
2016-12-06 09:46:47 +01:00
Mathew Sutcliffe
b62d1c303c
refs #783 Remove the flawed 4-arg version of BlackMisc::singleShot and change signature of 3-arg version.
2016-12-06 09:34:07 +01:00
Mathew Sutcliffe
64e2414b56
refs #783 Isolated improvements in BlackMisc::singleShot using QSharedPointer and C++14 lambda init-capture.
2016-12-06 09:34:06 +01:00
Mathew Sutcliffe
a30eb18a9c
On Windows, warn if a thread was terminated with its QThread still in running state.
...
I hope this catches if the data cache serializer is killed in the middle of a save.
2016-08-26 21:04:43 +01:00
Klaus Basan
dc02ff2d0c
Addded log categories / human readable pattern
2016-06-29 01:04:44 +02:00
Roland Winklmeier
3d7a39ed00
Fix BlackMisc header includes
...
* Include only what is used
* Use forward declaration when possible
* Sorted includes
refs #630
2016-05-13 17:05:49 +02:00
Mathew Sutcliffe
514d460e57
refs #628 Refactor CWorker::invoke into a free function and expand its API.
2016-04-03 18:17:40 +01:00
Mathew Sutcliffe
a895cc2c54
refs #624 Removed many workarounds, no longer needed.
2016-03-22 16:02:58 +00:00
Mathew Sutcliffe
a8fc899219
refs #624 Use std alias traits.
2016-03-22 16:02:48 +00:00
Mathew Sutcliffe
b33781717e
refs #624 Remove noexcept from destructors, which are implicitly noexcept.
2016-03-19 21:07:56 +00:00
Mathew Sutcliffe
c26a6fef8b
refs #624 Use noexcept instead of Q_DECL_NOEXCEPT.
2016-03-19 21:07:15 +00:00
Mathew Sutcliffe
1282fc4c14
refs #540 Add the ability to capture the current call stack, and use it in singleShot.
2015-12-08 22:30:10 +00:00
Mathew Sutcliffe
1dc4864ffa
refs #476 Facility to ask worker to abandon its task and finish early.
2015-11-26 18:24:10 +00:00
Mathew Sutcliffe
feeca47060
Assert earlier when thenWithResult type doesn't match lambda return type.
2015-11-19 21:05:18 +00:00