summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h3
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx12
-rw-r--r--include/comphelper/lok.hxx8
3 files changed, 22 insertions, 1 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index ed7f4e7f2d28..d924c416eb0b 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -140,6 +140,9 @@ struct _LibreOfficeKitClass
/// @see lok::Office::stopURP
void (*stopURP)(LibreOfficeKit* pThis, void* pSendURPToLOContext);
+
+ /// @see lok::Office::joinThreads
+ int (*joinThreads)(LibreOfficeKit* pThis);
};
#define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize)
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 6f75eb6be5cb..797dd6bca73b 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -1051,7 +1051,6 @@ public:
* @since LibreOffice 6.0
* @param pURL macro url to run
*/
-
bool runMacro( const char* pURL)
{
return mpThis->pClass->runMacro( mpThis, pURL );
@@ -1197,6 +1196,17 @@ public:
{
mpThis->pClass->stopURP(mpThis, pURPContext);
}
+
+ /**
+ * Joins all threads if possible to get down to a single process
+ * which can be forked from safely.
+ *
+ * @returns non-zero for successful join, 0 for failure.
+ */
+ int joinThreads()
+ {
+ return mpThis->pClass->joinThreads(mpThis);
+ }
};
/// Factory method to create a lok::Office instance.
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index 545136f762ea..4ca03f049225 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -20,6 +20,14 @@ class LanguageTag;
namespace comphelper::LibreOfficeKit
{
+/// interface for allowing threads to be transiently shutdown.
+class COMPHELPER_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") ThreadJoinable
+{
+public:
+ /// shutdown and join threads, @returns true on success
+ virtual bool joinThreads() = 0;
+};
+
// Functions to be called only from the LibreOfficeKit implementation in desktop, not from other
// places in LibreOffice code.