From ccc2e526d107a353469b5aad99e94544c07a10ee Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 27 Mar 2024 17:25:24 +0000 Subject: lok: add isForkedChild method. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This can be used to tag short-lived transient 'save' processes to encourage them not to mutate eg. filesystem state that is shared with the parent process. Change-Id: I027d18cbe4ce519b31c4fc1d3ac46b916d1efc87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165407 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit 9dab5edb90d14ad6f71cc2ac96cc504c1e8c290b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165427 Tested-by: Jenkins Reviewed-by: Michael Meeks --- comphelper/source/misc/lok.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'comphelper') diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx index b5cbcc74cb54..c042b0c626e5 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -19,6 +19,8 @@ namespace comphelper::LibreOfficeKit static bool g_bActive(false); +static bool g_bForkedChild(false); + static bool g_bPartInInvalidation(false); static bool g_bTiledPainting(false); @@ -98,6 +100,16 @@ bool isActive() return g_bActive; } +void setForkedChild(bool bIsChild) +{ + g_bForkedChild = bIsChild; +} + +bool isForkedChild() +{ + return g_bForkedChild; +} + void setPartInInvalidation(bool bPartInInvalidation) { g_bPartInInvalidation = bPartInInvalidation; -- cgit