aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/launcherinterface.h
Commit message (Collapse)AuthorAgeFilesLines
* Use SPDX license identifiersLucie GĂ©rard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: More forward declarations / drop unused headers [L-O]Jarek Kobus2022-05-251-4/+4
| | | | | | | | | | | | | | | Round 1 - focus on headers. For classes with initial in range [L-O]. Try to keep the same separators between different kind of headers. Drop changes to NameValueDictionary for now, as apparently environmentfwd.h is broken currently. It looks we can't forward declare the argument T inside QList<T> - the type must be complete. Change-Id: If26e88357a2ffbb91a79c4d003046443d98d5673 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* ProcessLauncher: Pass start packet into the launcher socketJarek Kobus2022-04-221-1/+0
| | | | | | | | | | | | | | | | | Instead of holding the start packet on caller side when launcher socket isn't ready yet, pass it into the launcher socket and buffer it there until the socket becomes ready. This simplifies starting the process considerably. Get rid of CallerHandle::canWaitFor(), as this is already checked by QtcProcess itself. Get rid of LauncherHandle::m_waitingFor field and LauncherInterface::isReady() method, as both are not used anymore. Change-Id: Ida6f0629170647249e562028c3ea5db1830b8a0d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* QtcProcess: Extract QtcProcess specific enums into separate headerJarek Kobus2022-02-181-1/+0
| | | | | | Change-Id: Ib3498f189000fd8f5501130c0d280b0f5ae83849 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* ProcessInterface: Drop ProcessMode from c'torJarek Kobus2022-02-181-2/+1
| | | | | | | | | Drop it also from registerHandle() methods, as it wasn't used there. Change-Id: I34b72c38368b82f22d73314fe3cd429ed43cadbc Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Introduce Utils::SingletonJarek Kobus2021-09-281-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce Utils::Singleton class and Utils::SingletonWithOptionalDependencies class template that helps implementing singletons that depend on other singletons. It's guaranteed that whenever singleton B depends on singleton A, than A is always created before B is being created, and that the order of destruction is always opposite to the order of creation. Dependencies of singleton are listed as template arguments for SingletonWithOptionalDependencies class template. The first argument of SingletonWithOptionalDependencies class template is always a singleton class itself. Prepare a common interface for all singleton subclasses: SingletonSubClass *SingletonWithOptionalDependencies::instance(); Make instantiating singletons and its dependencies thread-safe. Create singletons on demand (only if some code needs them). It's not needed anymore to explicitly instantiate all required singletons in tests. Make it possible (and thread-safe) to instantiate ProcessReaper and LauncherInterface singletons in non-main threads. Make the following dependencies between existing singletons: SshConnectionManager depends on: -> LauncherInterface depends on: -> ProcessReaper Change-Id: Iefaacab561c2b3dcf07e7fafbb87339ea6a15278 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Make all objects created by QtcProcess children of itJarek Kobus2021-09-031-1/+2
| | | | | | | | | | | Sometimes after creating QtcProcess we move it into a different thread. In this case we should move all the children, too. Without parent-child relation all the children will stay in the old thread. Change-Id: Ibde44d6153092a155dd2d200a7116a046910dddc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Make access to LauncherSocket thread safeJarek Kobus2021-08-311-3/+15
| | | | | | | | | | | | Instead of returning a pointer to LauncherSocket instance, which might get deleted in meantime of just after, route all calls to the LauncherSocket through the LauncherInterface. Make all calls to LauncherInterface secured by the instance mutex. Change-Id: I751228de5f4263112471098ee08cc73a5245147e Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix LauncherInterface's destructionJarek Kobus2021-08-241-1/+0
| | | | | | | | | | | | | | | Change the lifetime of LauncherInterface. Now it's being constructed when startLauncher() is called and destructed on stopLauncher(). Before, we hold the static LauncherInterface object and couldn't control when it's being destructed, so in fact the destruction started too late, after the QtSingleApplication's destructor finished. Simplify LauncherInterface::isStarted() method. Change-Id: I91f38212177318746d2530a418eb3efd3d9258cb Reviewed-by: hjk <hjk@qt.io>
* Assert that startLauncher() was called before starting any QtcProcessJarek Kobus2021-08-201-0/+1
| | | | | Change-Id: Ieab97f7428c04ba90fc9a637ed8c29c8e97dec69 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Assert that we are starting a valid process launcher executableJarek Kobus2021-08-201-3/+2
| | | | | Change-Id: I48b18bd4ce821d59622de77c602677303c9d7625 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Conform to Creator's include styleJarek Kobus2021-08-191-5/+0
| | | | | | | | | Get rid of <QtModule/qclass.h> style and use <QClass> directly, like in all other places in Creator. Remove some unneeded declarations. Change-Id: I1b5630850c570e5d86df01a341f7352bc1971e48 Reviewed-by: hjk <hjk@qt.io>
* Start and stop the process launcher in tst_qtcprocessJarek Kobus2021-08-191-1/+1
| | | | | | Change-Id: Ib28450d10c699abe3964f8bef2ff24baae0074f7 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Refactor process launcherJarek Kobus2021-07-161-15/+8
| | | | | | | | | | | | | Move launcher process into a separate thread. Implement blocking API by using wait condition on the caller's side. Replay all collected signals from the launcher's thread when leaving waitingFor* state. In case we were not waiting for anything deliver the signals asynchronously from launcher's thread to the caller's thread. Change-Id: Id44fe5f7ceaac407004984a1dfb6ea65f197d297 Reviewed-by: hjk <hjk@qt.io>
* Initial import of processlauncher copy from qbs projectJarek Kobus2021-07-081-0/+72
Change-Id: I9d646dd1a820e4e69c808998d9f12ff2f5dabe6d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>