Some baseline thoughts

Miklos Vajna vmiklos at collabora.co.uk
Wed May 31 20:06:52 UTC 2017


Hi,

On Wed, May 31, 2017 at 11:27:16AM +0200, Stephan Bergmann <sbergman at redhat.com> wrote:
> So after the recent bump to macOS 10.9, HAVE_THREADSAFE_STATICS should
> effectively be true everywhere expect on Android (where configure.ac doesn't
> bother at all to decide whether or not it would be true, always leaving it
> false; either because it is known to be false for the current Android
> baseline, or because those setting up Android support didn't bother).
> 
> Can somebody clarify the actual situation on Android?

As far as I can see it's the "because those setting up Android support
didn't bother" case. The attached patch does not break opening Writer
documents for me, so I guess it's safe to turn that "always false" to
"always true", as it happens on macOS.

Regards,

Miklos
-------------- next part --------------
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index c8755a246d39..d35acdebe197 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -40,6 +40,7 @@
 #include <ndindex.hxx>
 #include <accessibilityoptions.hxx>
 #include <calbck.hxx>
+#include <pthread.h>
 
 void SwViewShell::Init( const SwViewOption *pNewOpt )
 {
@@ -138,6 +139,18 @@ void SwViewShell::Init( const SwViewOption *pNewOpt )
     }
 }
 
+int h() { return 0; }
+void * g(void * /*unused*/) {
+  static int n = h();
+  return &n;
+}
+int f() {
+  pthread_t t;
+  pthread_create(&t, 0, g, 0);
+  pthread_join(t, 0);
+  return 0;
+}
+
 /// CTor for the first Shell.
 SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow,
                         const SwViewOption *pNewOpt, OutputDevice *pOutput,
@@ -166,6 +179,10 @@ SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow,
     mpPrePostOutDev(nullptr),
     maPrePostMapMode()
 {
+    SAL_DEBUG("SwViewShell ctor, before test");
+    static int n = f();
+    (void)n;
+    SAL_DEBUG("SwViewShell ctor, after test");
     // in order to suppress event handling in
     // <SwDrawContact::Changed> during construction of <SwViewShell> instance
     mbInConstructor = true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20170531/f9cd0017/attachment.sig>


More information about the LibreOffice mailing list