summaryrefslogtreecommitdiff
path: root/vcl/headless/headlessinst.cxx
AgeCommit message (Collapse)Author
2022-06-23Revert "svp: don't directly yield in main thread"Stephan Bergmann
This reverts commit d2de55c93f94bbccff51fa7715b613341f1f4ae6 for now, because it appears to have caused a massive uptick in hung UITest_impress_tests (sd/qa/uitest/impress_tests/save_readonly_with_password.py, line 95) and UITest_writer_test6 (sw/qa/uitest/writer_tests6/save_readonly_with_password.py, line 54) tests across Jenkins, see the comments starting at <https://gerrit.libreoffice.org/c/core/+/117900/8#message-e439f5f2b9ed7a24d6f47fd640defe14dc392eb5> "svp: don't directly yield in main thread". Change-Id: Id114a0d904580024352e4acf37e2558f9f0ae6f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136250 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-22svp: don't directly yield in main threadJan-Marek Glogowski
AKA svp: always release SolarMutex on yield, v2 Implement the TODO when yielding a non-main thread: "use a SolarMutexReleaser here and drop the m_bNoYieldLock usage" This whole concept of "deferred yield" is prone to spurious "deadlocks", if DoYield spawns a nested event loop. This will not only block one yielding threads, but all indefinitly. And not releasing the SolarMutex is also not fair for any other threads waiting. That whole m_nNoYieldLock hack is just needed to defer GUI processing to the main thread without releasing the SolarMutex, the exact opposite of what yielding does. While we can't do anything for the main thread as long as the whole nested event loop concept prevails, we can prevent the yielding thread deadlock using conditionals. With all the special m_nNoYieldLock gone from SvpSalYieldMutex there isn't any reason to keep it around. Change-Id: I87c006ad36b4959f7e0dd18dda99a58c4e25032d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117900 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-17iOS+SVP convert remaining VCL plugins to salplugJan-Marek Glogowski
While this makes the preprocessor usage even larger, the code in salplug.cxx is now hopefully easier to follow. I added a comment about the main code structure at the beginning. It also includes changes to the generic plugin list to include gtk3_kde5 before gen, qt5 and qt6 after gen, but still skips the headless / svp plugin. And I explicitly excluded salplug.cxx from the externandnotdefined compiler plugin. I could have added a dummy, but that seemed not worth the effort. My try on a non-dummy with correct includes and defines made the code in salplug.cxx much harder to follow. FWIW, the iOS VCL plugin actually seems to use the osx SalData, so I think these changes to iosinst.cxx are more correct then commit 7d990aafdc363b2a12b5db78637d7f3bef7780bd ("VCL drop m_pInstance from *nix SalData"). But hard to tell without a compiler. Change-Id: I0e2944d4221ca5910fb2120cc8b24def5c5b3f33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128477 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-14VCL move SolarMutex (un)locking into (De)InitVCLJan-Marek Glogowski
Fixes all the backends, where SolarMutex access needs SalInstance. The ImplSVData::SalInstance is just set fron the return value of CreateSalInstance, so it can't be accessed earlier, globally. Regression from commit ad94bb5d23d9c4ecbb2ca84807f01623862de43e ("VCL drop m_pInstance from *nix SalData). Change-Id: I13259009571a9973ea7e3ded20c0ea4c660ee214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128420 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-14VCL drop m_pInstance from *nix SalDataJan-Marek Glogowski
AKA the "*nix SalData untangling" commit. The original plan was to get rid of vcl/inc/saldatabasic.hxx and even SalData for all the *nix backends. But after many backs and forths, reinspecting the code and imagining the resulting code, I decided against that plan. All these variants would have resulted in reinterpret_cast calls, I wanted to prevent. And they would have required larger renames for no benefit. An other, related idea was to include all SalData implementations in the vcl/inc/svdata.hxx header, but that seemed like an include explosion, so was also dropped. I tried to untangling iOS from using GenericUnixSalData, as it doesn't use any of it's features. The new, minimal SalData should be sufficient. I'm leaving the easier drop of mpInstance from the Windows and MacOSX backend as a minimal interesting EasyHack. Change-Id: I5be01c1f42131a7e31cb30899392308e1e2de53b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128402 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-14ofz: fix build. error: missing member 'm_pPIManager'Caolán McNamara
probably since... commit bc3f70f220091f09ad02c148a6a49fdccb7b85c5 Date: Thu Jan 13 20:15:39 2022 +0100 VCL move PrinterInfoManager into GenericUnixSalData ... and use a std::unique_ptr. Change-Id: I07ffed4f722e30269ddf4828ffba3ac34952adb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128417 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-01-14iOS+Android+SVP "merge" all SalData instancesJan-Marek Glogowski
It's always the same code. Change-Id: I2385d0bda24939b964306e27a3df99ea44356eac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128401 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-07-02vcl: drop GenericUnixSalDataTypeJan-Marek Glogowski
It's just used for a singke assert and SalData is generally just used as a static cast. Change-Id: I8d74e82e511413d940a3f200f022a9204e588cd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118288 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-05-13error: use of undeclared identifier '_exit'Caolán McNamara
Change-Id: I6802c8afe4b02ec8398fa9d62728694ddc6f770f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115539 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-20tdf#130924 [vcl] replace `*printf`s with `SAL_*` logging macros.Yukio Siraichi
Change-Id: Ie3ec1e1767478bce12eecf7bfee02ed2d45fe58c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92331 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-08o3tl::make_unique -> std::make_unique in tools..xmloffGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Ib3201f865d43f372007cdf381c7e244e9cbeae26 Reviewed-on: https://gerrit.libreoffice.org/67474 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-10Resolves: ofz#12462 fix build failureCaolán McNamara
Change-Id: I6719a601b5f9e5b727406667f36a8bef93eb2adc Reviewed-on: https://gerrit.libreoffice.org/66081 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-02Unify sal plugin loadersJan-Marek Glogowski
Change-Id: Ic099761eaff80349e985ccf62e3f4aa6b2e98022 Reviewed-on: https://gerrit.libreoffice.org/61103 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-08-22fix oss-fuzz buildCaolán McNamara
Change-Id: Idec87abc7c7ec030e299a5dd582d6c1c44ae1a32 Reviewed-on: https://gerrit.libreoffice.org/59440 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-26vcl: fix hangs in SvpSalInstanceMichael Stahl
Since commit cb8bfa9a32799bcde4e960fa56e388d5f7b2a928 the main thread will read from the timer pipe until it is empty. But evidently this introduces the problem that the poll() in another thread will not return, as the file descriptor will no longer be readable; see https://paste.debian.net/1011306/ for a reproducer of that rather under-documented poll behaviour. So other threads can get stuck forever in poll, and then the main thread can block in poll too with no other thread to wake it up. This is the problem that plagues UITest_writerperfect_epubexport. The timer pipe is difficult to fix, since the main thread can block on either the poll or the subsequent AcquireYieldMutex(). So replace the timer pipe with a condition etc. that is mostly copied from the OSX AquaSalInstance/SalYieldMutex implementation. The main thread now does something different than the other threads, and blocks on a condition_variable with a timeout, while other threads still block on acquiring the mutex. Non-main threads can poke the main thread to do a DoYield() on their behalf, and then get the result back with a blocking read from a pipe, all while holding the YieldMutex. This requires some fudging of the YieldMutex so that the main thread can borrow the ownership temporarily. Unfortunately SvpSalInstance, in addition to being directly instantiable for --headless, has a whole bunch of subclasses: * HeadlessSalInstance * AndroidSalInstance * IosSalInstance * GtkInstance (in the gtk3 case) * KDE5SalInstance Of these GtkInstance overrides everything related to the DoYield/SalYieldMutex implementation, but the others will be affected by the change. This commit will probably break IOS due to me not understanding the point of the undocumented random #ifdef IOS in svpinst.cxx. Change-Id: I1bbb143952dda89579e97ac32cd147e5b987573c Reviewed-on: https://gerrit.libreoffice.org/50237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-11-11Replace list by vector for ShowNativeDialog (vcl)Julien Nabet
Change-Id: I1101c5b5426507ce8e5fd1ed34930f385f527775 Reviewed-on: https://gerrit.libreoffice.org/44639 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-31ReleaseYieldMutex is always called with trueNoel Grandin
so drop param and rename to ReleaseYieldMutexAll Change-Id: Ic4fcee24d46405659e54363c87f21d88696b0ce1 Reviewed-on: https://gerrit.libreoffice.org/44057 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-19rename SalGenericData to GenericUnixSalDataNoel Grandin
since it's generic over the various unixen, not anything else Change-Id: I994d5c9be99134b804e96bc045bf054fd9b434ef Reviewed-on: https://gerrit.libreoffice.org/42455 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-19Unify SolarMutex implementationsJan-Marek Glogowski
All backends implement the SolarMutex in mostly the same way. So this consolidates this code into a GenericSolarMutex. We still need the abstract SolarMutex class for the fake AKA fascade implementation in dbaccess. The patch also replaces various places of direct mutex usage with either SolarMutexGuard or SolarMutexReleaser objects. Change-Id: Ia0146dd6c51a3b9a513cc6af34a66def58aad831 Reviewed-on: https://gerrit.libreoffice.org/42325 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2017-08-08loplugin:constantparamNoel Grandin
Change-Id: Ib92aba17c46a4ada75c2a0630f281759d995f32e Reviewed-on: https://gerrit.libreoffice.org/40843 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-18fix the headless plugin after removal of unused variablesMarkus Mohrhard
Change-Id: I3681cdbb128575fdb9ce389c6da34bf637f3e38c
2016-12-12loplugin:overrideTor Lillqvist
Change-Id: I7ef42d66a0ffbbd8f2754bd4aba0e77659c9ae83
2016-12-12loplugin:nullptrTor Lillqvist
Change-Id: I6ab405e7e9a0c8ac3a323fd2484e334c500280ae
2016-12-12loplugin:unnecessaryoverrideTor Lillqvist
Change-Id: I45d7e14cef0058c4bfca4a3466e31d64e29bdfae
2016-03-25fix headless buildOliver Specht
disables OpenGL and glew usage, lets --without-gui do what --without-x did before and disables X related test Change-Id: I680b47c9962a0d43c8ece593db0b82e347ceebdb Reviewed-on: https://gerrit.libreoffice.org/23474 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-05-25cppcheck: noExplicitConstructorCaolán McNamara
Change-Id: I62076450ab77472bfd09b3fb9824f54b6ea1e0f7
2013-04-22Move to MPLv2 license headers, with ESC decision and author's permission.Michael Meeks
2013-01-30Remove unused DeInitSalMainStephan Bergmann
Change-Id: I8fd733fe6535cc4f9f299f53adc1821ce344a85c
2012-12-20vcl/headless: some more string cleanupRiccardo Magliocchetti
As suggested by Olivier Hallot and Lubos Lunak Change-Id: Ie5d9f379294b004992dab0b98d6dfa4aa5456159
2012-12-20vcl/headless: remove rtl namespace prefix from OUstring methodsRiccardo Magliocchetti
Change-Id: Ic3948384bc1709d648507c41542c34437abea468 Reviewed-on: https://gerrit.libreoffice.org/1422 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
2012-12-12Consistently acquire solar mutex in all CreateSalInstance variantsStephan Bergmann
...where all but the variants for Android and --enable-headless already did so (and curiously the DestroySalInstance variants for Android and --enable-headless already contained code to release the solar mutex). See the thread at <http://lists.freedesktop.org/archives/libreoffice/2012-December/042535.html> "--headless broken with --enable-headless" for further details. Change-Id: I01be2e237e203a151ea8b1f3adfbcb3e63247cd7
2012-02-21headless: more work in vclRiccardo Magliocchetti
Provide HeadlessSalSystem::ShowNativeDialog() instead of having it if-zeroed. Then remove LIBO_HEADLESS ifdefery from unx/generic/plugadapt/salplug.cxx which we are not building anymore.
2012-02-17Introduce headless switch for X / cairo / toolkit less buildRiccardo Magliocchetti
The plan is to reduce dependencies to be easier to deploy libreoffice server side in headless mode.